Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gthread: consider intial connectino as idle
this change consider the connection is iddle when started and remove it from the eventloop if no change appears in the interval. This prevents the connection queued for too much time.
- Loading branch information
e7781d2
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.
Hi Benoit,
I've run into a problem with this. This change results in each connection being added to the _keep queue twice.
The first time on_client_socket_readable() is called, it only removes the connection from _keep if the connection is initialised, but the connection is not initialised at this point, and does not get initialised until the following call to self.enqueue_req(conn).
When the request completes, finish_request() will add the connection to _keep, so it's now in the queue twice.
When murder_keepalived() is called, it hits a ValueError in self.poller.unregister(conn.sock) when it tries to remove the second copy of the connection, as the connection is already closed.
Suggest solution is to remove the connection from _keep if not is not initialised in on_client_socket_readable(), and clear the initialized flag in finish_request() before returning the connection to _keep.
e7781d2
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.
sorry i didn't get the notification. looking