prevent shutdown issues by making server thread daemonic#411
Merged
csernazs merged 1 commit intocsernazs:masterfrom Apr 9, 2025
Merged
prevent shutdown issues by making server thread daemonic#411csernazs merged 1 commit intocsernazs:masterfrom
csernazs merged 1 commit intocsernazs:masterfrom
Conversation
Owner
|
Hi @alexrashed , Thanks for the PR, it looks good - this thread should not block when the process exits. Thank you, |
Owner
|
Could you please squash the two commits to one? Precommit bot added a fix to your commit. |
e62efdf to
b14f3b5
Compare
b14f3b5 to
2424568
Compare
Owner
|
Thanks! I'll do a release soon and let you know about it. |
csernazs
added a commit
that referenced
this pull request
Apr 10, 2025
csernazs
added a commit
that referenced
this pull request
Apr 10, 2025
csernazs
added a commit
that referenced
this pull request
Apr 10, 2025
csernazs
added a commit
that referenced
this pull request
Apr 10, 2025
Owner
|
hi @alexrashed, Version 1.1.3 has just been released with your fix. Please give it a try if you can. Thanks again for your contribution, |
Contributor
Author
|
This is great, thanks a lot for merging the PR and creating a release! 🥳 |
zifeo
pushed a commit
to zifeo/dataconf
that referenced
this pull request
May 1, 2025
Bumps [pytest-httpserver](https://github.com/csernazs/pytest-httpserver) from 1.1.2 to 1.1.3. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/csernazs/pytest-httpserver/releases">pytest-httpserver's releases</a>.</em></p> <blockquote> <h2>1.1.3</h2> <ul> <li>Run server threads with daemon flag, preventing shutdown issues. <a href="https://redirect.github.com/csernazs/pytest-httpserver/issues/411">#411</a></li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/csernazs/pytest-httpserver/blob/master/CHANGES.rst">pytest-httpserver's changelog</a>.</em></p> <blockquote> <h1>1.1.3</h1> <p>.. _Release Notes_1.1.3_Bug Fixes:</p> <h2>Bug Fixes</h2> <ul> <li>Run server threads with daemon flag, preventing shutdown issues. <code>[#411](csernazs/pytest-httpserver#411) <https://github.com/csernazs/pytest-httpserver/pull/411></code>_</li> </ul> <p>.. _Release Notes_1.1.2:</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/68b7ce56d640a9e40c03c7c914cead6193c84bc8"><code>68b7ce5</code></a> CHANGES.rst: add release notes for 1.1.3</li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/7ae4709662e71d35e53c86930a3acda3cb8baf88"><code>7ae4709</code></a> Version bump to 1.1.3</li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/a00d8a4a20029ce651bb9a99226747fbbd528268"><code>a00d8a4</code></a> releasenotes: add release note for <a href="https://redirect.github.com/csernazs/pytest-httpserver/issues/411">#411</a></li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/e9010dc0a42331a075828929d794944e57364157"><code>e9010dc</code></a> [pre-commit.ci] pre-commit autoupdate</li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/32a25e95dcc09a87a28036c8de3da55b1a17a4b6"><code>32a25e9</code></a> explicitly spawn daemon thread for http server</li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/414173b8d22b92c32f8a294bf999909954713009"><code>414173b</code></a> build(deps-dev): bump the deps group with 5 updates</li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/5acead44e5df4902b502e14a4e4b15e5b93b0061"><code>5acead4</code></a> [pre-commit.ci] pre-commit autoupdate</li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/97dba58fb28597762a2eba794ba4489e14aa2fdb"><code>97dba58</code></a> [pre-commit.ci] pre-commit autoupdate</li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/a0da3951da3763566761195c05891f967e3bc0d5"><code>a0da395</code></a> [pre-commit.ci] pre-commit autoupdate</li> <li><a href="https://github.com/csernazs/pytest-httpserver/commit/178ded6de4b0aa9d5138d72124341fdcb289f19a"><code>178ded6</code></a> [pre-commit.ci] pre-commit autoupdate</li> <li>Additional commits viewable in <a href="https://github.com/csernazs/pytest-httpserver/compare/1.1.2...1.1.3">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
In the LocalStack test codebase we heavily use LocalStack to test integrations of our emulated AWS services. Thanks for the great project!
In the past we were facing issues with our integration tests timing out due to shutdowns being blocked. It turns out that some of the
pytest-httpserverthreads were not properly shut down. @bentsku fixed this by patching theHTTPServerclass to spawn a deamon thread to make sure that it cannot block the shutdown of the interpreter with localstack/localstack#10052.This patch broke with the latest release, as the
startmethod was modified (which is why we did not upgrade to the latest version 1.1.2, but introduced an upper limit with localstack/localstack@01a97ba).This PR aims at fixing these issues upstream to prevent issues like this for other users, as well as to be able to remove the patch in our projects.
Changes