Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAX_CONN_COUNTER will always increase, no decrease #200

Open
clia opened this issue Sep 22, 2020 · 3 comments
Open

MAX_CONN_COUNTER will always increase, no decrease #200

clia opened this issue Sep 22, 2020 · 3 comments

Comments

@clia
Copy link

clia commented Sep 22, 2020

The number setted with max_connection_rate will exceed after a period of time of running.
I checked the code about lib.rs and openssl.rs in actix-tls/src, and can find only the code to increase the MAX_CONN_COUNTER counter, no decreasing action.
I think this is a bug.

@robjtede
Copy link
Member

From what i can see, the thread local counter is incremented when a guard is created and decremented when the guard is dropped. Can you show where you think the problem is?

@fakeshadow
Copy link
Contributor

RAII type guard with operation on drop is a normal pattern in Rust. It's a feature.

@clia
Copy link
Author

clia commented Sep 23, 2020

actix-issue

Yes it will decrease, but the counter num will totally increase over time. We are running a SSE long-polling connections service, I set the max_connection_rate to 2560. When the most clients has connected to our server, and the connections peak is over, the connection count is decreasing, the MAX_CONN_COUNTER value is still increasing, reaches the limit, while the connection rate is obviously low.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants