Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-69282: test_httpservers hangs since Python 3.5#9564

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
WildCard65 wants to merge7 commits intopython:main
base:main
Choose a base branch
Loading
fromWildCard65:fix_bpo25095

Conversation

WildCard65
Copy link
Contributor

@WildCard65WildCard65 commentedSep 25, 2018
edited by bedevere-bot
Loading

Added the following headers to RequestHandlerLoggingTestCase.test_get HTTP client request: Connection (value; close), Content-Length (value: 0)

This is a remake of the PR due to screw up I made in the last one.

https://bugs.python.org/issue25095

@matrixise
Copy link
Member

@vadmium what do you think about this PR?

@csabellacsabella requested review fromvadmium and removed request forvadmiumFebruary 4, 2020 01:24
@csabella
Copy link
Contributor

@WildCard65, please address the comments that@vadmium left on the bug tracker for this. Thank you!

Added 'self.con.close()' after 'self.con.getresponse()' to close the socket connection.Kept the 'Connection' header in the request to signal our intent to terminate the socket.
@WildCard65
Copy link
ContributorAuthor

@csabella I made the requested changes.

@hugovk
Copy link
Member

This is ready for review.

arhadthedev reacted with thumbs up emoji

@ambvambv removed the needs backport to 3.9only security fixes labelMay 17, 2022
@ambv
Copy link
Contributor

This missed the boat for inclusion in Python 3.9 which accepts security fixes only as of today.

@hauntsaninjahauntsaninja changed the titlebpo-25095: test_httpservers hangs since Python 3.5gh-69282: test_httpservers hangs since Python 3.5Feb 9, 2023
@arhadthedev
Copy link
Member

#69282 (comment)

@hugovkhugovk removed the needs backport to 3.10only security fixes labelApr 6, 2023
@AA-TurnerAA-Turner added the needs backport to 3.12only security fixes labelAug 13, 2023
Copy link
Member

@AA-TurnerAA-Turner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This patch seems fine and addresses all the points raised in#69282.

A

@terryjreedy
Copy link
Member

This issue and PR are no longer needed in that test_httpservers runs fine since 3.9. If some coredev familiar enough with httpserver thinks that the changes are a good idea anyway, please merge.

@hugovkhugovk added the pendingThe issue will be closed if no feedback is provided labelDec 19, 2023
@serhiy-storchakaserhiy-storchaka added needs backport to 3.13bugs and security fixes and removed needs backport to 3.11only security fixes labelsMay 9, 2024
@nineteendo
Copy link
Contributor

Do we close this or do we remove the pending label?

Copy link
Member

@vadmiumvadmium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think the current proposed changes should fix the firewall problem as I understand it. The changes are a bit clumsy, but overall beneficial.

I don’t see any reason why the problem would already be fixed. Maybe@terryjreedy it’s just that you originally had a firewall interfering, but it isn’t any more?

self.send_response(HTTPStatus.OK)
self.send_header('Content-Length', 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

(Nitpick) It’s not really documented, and seems to work regardless, but I assume the header field value should be a string '0' not an integer

# To combat this, we send the test server the "Connection" header
# with "close" for the value forcing the server and client to
# terminate the socket allowing the test to resume.
self.con.request('GET', '/', headers={'Connection': 'close'})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The explanation seems vague. I would explain it as:

“Connection: close” causes the server to set its “close_connection” flag. If the client did not also shut down the connection below, this flag would avoid a deadlock between the server waiting for a second request on the connection, and the main thread shutting the server down.

@terryjreedy
Copy link
Member

I have no idea why the test failed and then passed again on my machine. It works now as is on a debug no-gil build. I do know that code can be improved, and maybe made more stable, even if not failing on a particular machine at a particular time. Please judge on that basis. I also know that tests that pass on GH CI machines may fail on my machine, and vice versa, and need revision to run better on both and others.

@github-actionsGitHub Actions
Copy link

This PR is stale because it has been open for 30 days with no activity.

@github-actionsgithub-actionsbot added the staleStale PR or inactive for long period of time. labelFeb 27, 2025
@hugovkhugovk removed the needs backport to 3.12only security fixes labelApr 10, 2025
@github-actionsgithub-actionsbot removed the staleStale PR or inactive for long period of time. labelApr 13, 2025
@serhiy-storchakaserhiy-storchaka added the needs backport to 3.14bugs and security fixes labelMay 8, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@vadmiumvadmiumvadmium left review comments

@AA-TurnerAA-TurnerAA-Turner approved these changes

Assignees
No one assigned
Labels
awaiting core reviewneeds backport to 3.13bugs and security fixesneeds backport to 3.14bugs and security fixespendingThe issue will be closed if no feedback is providedskip newstestsTests in the Lib/test dir
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

17 participants
@WildCard65@matrixise@csabella@hugovk@ambv@arhadthedev@terryjreedy@nineteendo@vadmium@AA-Turner@berkerpeksag@tiran@serhiy-storchaka@the-knights-who-say-ni@ezio-melotti@bedevere-bot@JelleZijlstra

[8]ページ先頭

©2009-2025 Movatter.jp