-
Notifications
You must be signed in to change notification settings - Fork 143
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
Main Thread Panic when swarmed with clients #158
Conversation
drdrsh
commented
Sep 5, 2022
•
edited
edited
We might want to consider setting max client connections at some point |
@@ -95,7 +95,7 @@ pub async fn client_entrypoint( | |||
mut stream: TcpStream, | |||
client_server_map: ClientServerMap, | |||
shutdown: Receiver<()>, | |||
drain: Sender<i8>, | |||
drain: Sender<i32>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, I forgot we're keeping this one alive until the client disconnects. Good catch. I'd make it a usize
to avoid this problem forever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought....we're only sending 1
and 0
through this channel. Why would it overflow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, because total_clients
becomes an i8
. Wow! Subtle.
That limit ended up always being a file descriptor issue, not anything to do with the proxy itself. All of our data structures should be O(1), so number of clients shouldn't matter. |