◐ Shell
clean mode source ↗

bpo-35017: Lib/socketserver, do not accept any request after shutdown by beledouxdenis · Pull Request #9952 · python/cpython

tirkarthi

vstinner

…ythonGH-9952)

Prior to this revision,
After the shutdown of a `BaseServer`,
the server accepted a last single request
if it was sent between the server socket polling
and the polling timeout.

This can be problematic for instance
for a server restart
for which you do not want to interrupt the service,
by not closing the listening socket during the restart.
One request failed because of this behavior.

Note that only one request failed,
following requests were not accepted, as expected.

vstinner

This test can fail on slow buildbots,
because it relies on a time condition

The unit test can be safely removed,
the fix being quite trivial.
The news message now represents what the revision
is changing regarding the behavior rather
than describing the current unexpected behavior.

vstinner

@beledouxdenis

vstinner

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Oct 26, 2018
…H-9952)

Prior to this revision, after the shutdown of a `BaseServer`,
the server accepted a last single request
if it was sent between the server socket polling
and the polling timeout.

This can be problematic for instance for a server restart
for which you do not want to interrupt the service,
by not closing the listening socket during the restart.
One request failed because of this behavior.

Note that only one request failed,
following requests were not accepted, as expected.
(cherry picked from commit 10cb376)

Co-authored-by: Denis Ledoux <be.ledoux.denis@gmail.com>

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Oct 26, 2018
…H-9952)

Prior to this revision, after the shutdown of a `BaseServer`,
the server accepted a last single request
if it was sent between the server socket polling
and the polling timeout.

This can be problematic for instance for a server restart
for which you do not want to interrupt the service,
by not closing the listening socket during the restart.
One request failed because of this behavior.

Note that only one request failed,
following requests were not accepted, as expected.
(cherry picked from commit 10cb376)

Co-authored-by: Denis Ledoux <be.ledoux.denis@gmail.com>

vstinner added a commit that referenced this pull request

Oct 26, 2018

miss-islington added a commit that referenced this pull request

Oct 26, 2018
Prior to this revision, after the shutdown of a `BaseServer`,
the server accepted a last single request
if it was sent between the server socket polling
and the polling timeout.

This can be problematic for instance for a server restart
for which you do not want to interrupt the service,
by not closing the listening socket during the restart.
One request failed because of this behavior.

Note that only one request failed,
following requests were not accepted, as expected.
(cherry picked from commit 10cb376)

Co-authored-by: Denis Ledoux <be.ledoux.denis@gmail.com>

miss-islington added a commit that referenced this pull request

Oct 26, 2018
Prior to this revision, after the shutdown of a `BaseServer`,
the server accepted a last single request
if it was sent between the server socket polling
and the polling timeout.

This can be problematic for instance for a server restart
for which you do not want to interrupt the service,
by not closing the listening socket during the restart.
One request failed because of this behavior.

Note that only one request failed,
following requests were not accepted, as expected.
(cherry picked from commit 10cb376)

Co-authored-by: Denis Ledoux <be.ledoux.denis@gmail.com>

beledouxdenis added a commit to beledouxdenis/cpython that referenced this pull request

Oct 26, 2018
…H-9952)

Prior to this revision, after the shutdown of a `BaseServer`,
the server accepted a last single request
if it was sent between the server socket polling
and the polling timeout.

This can be problematic for instance for a server restart
for which you do not want to interrupt the service,
by not closing the listening socket during the restart.
One request failed because of this behavior.

Note that only one request failed,
following requests were not accepted, as expected.

(cherry picked from commit 10cb376)

vstinner pushed a commit that referenced this pull request

Oct 26, 2018
GH-10129)

Prior to this revision, after the shutdown of a `BaseServer`,
the server accepted a last single request
if it was sent between the server socket polling
and the polling timeout.

This can be problematic for instance for a server restart
for which you do not want to interrupt the service,
by not closing the listening socket during the restart.
One request failed because of this behavior.

Note that only one request failed,
following requests were not accepted, as expected.

(cherry picked from commit 10cb376)

beledouxdenis added a commit to odoo-dev/odoo that referenced this pull request

Dec 21, 2018
The method override `_handle_request_noblock`
is there to solve a bug in Python socketserver library
which has been solved in
- Python 3.6: python/cpython@8b1f52b,
- Python 3.7: python/cpython@9080824,

through PR python/cpython#9952.

These revisions will be included in Python releases 3.6.8 and 3.7.2,
and the override will then become useless.
We therefore can remove the `_handle_request_noblock` override
as soon as the Python 3 releases installed on operating systems
supported by Odoo are above
- 3.6.8 for Python 3.6
- 3.7.2 for Python 3.7

robodoo pushed a commit to odoo/odoo that referenced this pull request

Dec 21, 2018
The method override `_handle_request_noblock`
is there to solve a bug in Python socketserver library
which has been solved in
- Python 3.6: python/cpython@8b1f52b,
- Python 3.7: python/cpython@9080824,

through PR python/cpython#9952.

These revisions will be included in Python releases 3.6.8 and 3.7.2,
and the override will then become useless.
We therefore can remove the `_handle_request_noblock` override
as soon as the Python 3 releases installed on operating systems
supported by Odoo are above
- 3.6.8 for Python 3.6
- 3.7.2 for Python 3.7

closes #29706