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

Added extra debug and moved setting client timeout to just before the… #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

v6ops
Copy link

@v6ops v6ops commented Mar 18, 2024

Suggested patch to Issue #4 Handling of queued clients and timeout.

The read timeout on the client event was originally set at the time of the event accepting the socket connection in on_accept(). The accept is non-blocking so gets executed as soon as an incoming TCP connection arrives. The job was then entered onto the work queue, but not serviced if there were already no free threads available. Result was that the timeout expired before the worker thread could execute a read event, leading to "tail drop" of all events in the queue.

The patch modifies the timeout to be set just before the event is dispatched from the work queue i.e. in server_job_function() when the job has been pulled from the queue and there is a thread available to actually service the job. This means the timer is individual and relative to when the worker thread starts work for this client. Clients may still time out (at their end) waiting for service, but this change avoids the server opening connections and then not providing any service before timing out for all waiting jobs in the work queue.

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

Successfully merging this pull request may close these issues.

1 participant