Comments (7)
Thanks for reporting this. I'll give it a look and try to fix it as soon as possible.
from mosquitto-go-auth.
I haven't been able to reproduce this. Are you sure it's the plugin the one not returning the file descriptors and not something else? Are you testing this against an HTTP service in the same machine which could potentially be the culprit?
from mosquitto-go-auth.
@iegomez
sorry for late response
i solved it by moving htpp client and http transport into HTTP struct
type HTTP struct {
UserUri string
SuperuserUri string
AclUri string
Host string
Port string
WithTLS bool
VerifyPeer bool
ParamsMode string
ResponseMode string
Client *h.Client
Transport *h.Transport
}
and initialize inside NewHTTP
tr := &h.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
client := &h.Client{Timeout: 5 * time.Second}
client.Transport = tr
//Initialize with defaults
var http = HTTP{
WithTLS: false,
VerifyPeer: false,
ResponseMode: "status",
ParamsMode: "json",
Transport: tr,
Client: client,
}
from mosquitto-go-auth.
Hi all, I see issue is closed, but no there is no fix in codebase. I see same behavior as @wattanakorn495 - both mosquitto and http service run on same machine in my case (two docker containers). Mosquitto quickly consumes all sockets (~54K) under the small load and is not able to open any HTTP requests towards authentication HTTP service anymore.
What was the reason for closing this issue, please?
from mosquitto-go-auth.
It was closed by the OP because he found a solution. As I wasn't able to reproduce the problem, I didn't make any changes to the code. I'm opening the issue again in case you can provide any more details on the error.
from mosquitto-go-auth.
I was able to reproduce the problem. My setup is simple - single machine with dockers, where mosquitto + auth plugin is running in one docker container, the auth service, written in go, runs in another container. I'm sure it can be reproduced by anybody who tries it, nothing complex to set up.
I first tried to test my auth service independently from fake client, which generated "mosquitto-auth-like" calls (user, superuser, acl), to be sure the consumption of file descriptors isn't on auth service side. It was ok.
Then I found the issue and tried what @wattanakorn495 posted here. I'm talking about this commit in his/her fork: wattanakorn495/mosquitto-go-auth@4f0b3d2. It contains more touches (super user checking, Dockerfile additions). So I finally created this commit in my fork: mnezerka/mosquitto-go-auth@13f2b40. It seems it helped, my server is running more than two days under load and number of file descriptors is constant.
It is sad that I didn't found any bug in your code, I see your are closing Body correctly and I don't see anything smart on moving Client instance up and reusing it for all http requests. That's probably a reason why people have it in forks instead of coming with PR.
from mosquitto-go-auth.
Thanks for the detailed description. And I agree, it doesn't make sense that the connections leak, but if it's presenting a real problem to users such as yourself then I'll gladly accept a PR with the mentioned change if you're willing to take the time.
from mosquitto-go-auth.
Related Issues (20)
- Implementing mosquitto_psk_key_get for certificate whitelisting HOT 8
- JWT backend JS mode not working HOT 1
- How to check if a client is disconnected from the broker HOT 2
- MongoDB is broken in test Docker image HOT 4
- Not authenticating with mysql db
- The plugin cannot be built HOT 1
- Request: Help in setting up Allow/Deny Access Control Rules based on Client ID HOT 4
- TARGETPLATFORM does not include linux/amd64 in Dockerfile HOT 2
- http backend: superuser check is made for every single acl check HOT 6
- Make order of plugin execution configurable
- Update/Fix dependencies with active vulnerabilities HOT 1
- error compiling on raspberry pi HOT 1
- Hasher configuration alway defaults to Base64 HOT 1
- the doc should specify which auth methods support TCP and Websocket connections HOT 1
- Container image on Dockerhub is outdated
- Inconsistent rw Permission Behavior Not Matching Documentation HOT 4
- JWT RS256 public key verification "jwt parse error: key is of invalid type"
- Backend register error: couldn't initialize js backend with error Javascript backend error: missing options: js_acl_script_path.
- Allow for clientId to be passed to postgres GetUser backend password check HOT 4
- jwt no information is sent to the endpoints HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mosquitto-go-auth.