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

test_query_e2e: interrupt process only once #614

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

skshetry
Copy link
Member

No description provided.

Copy link

cloudflare-workers-and-pages bot commented Nov 22, 2024

Deploying datachain-documentation with  Cloudflare Pages  Cloudflare Pages

Latest commit: ae02ab3
Status: ✅  Deploy successful!
Preview URL: https://f36b37ef.datachain-documentation.pages.dev
Branch Preview URL: https://interrupt-only-once.datachain-documentation.pages.dev

View logs

Copy link

codecov bot commented Nov 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.64%. Comparing base (644c51f) to head (ae02ab3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #614   +/-   ##
=======================================
  Coverage   87.64%   87.64%           
=======================================
  Files         106      106           
  Lines       10286    10288    +2     
  Branches     1386     1386           
=======================================
+ Hits         9015     9017    +2     
  Misses        929      929           
  Partials      342      342           
Flag Coverage Δ
datachain 87.58% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

…rrupt

While running script, sending <kbd>Ctrl</kbd> + <kbd>C</kbd> would also send SIGINT to
the worker processes, but then [it would immediately follow up with a SIKILL][1] [after 0.25s][2].

This allowed very little time for workers to do cleanup, due to which, Python was raising `UserWarning`
for leaked semaphores due to this:

```py
.../lib/python3.12/site-packages/multiprocess/resource_tracker.py:257: UserWarning: resource_tracker: There appear to be 6 leaked semaphore objects to clean up at shutdown
```

Also see python/cpython#70130.

This patch changes worker processes to be run using `subprocess.Popen`
rather than `subprocess.run`, so that SIGKILL never gets sent.

[1]: https://github.com/python/cpython/blob/3c770e3f0978d825c5ebea98fcd654660e7e135f/Lib/subprocess.py#L571-L573
[2]: https://github.com/python/cpython/blob/3c770e3f0978d825c5ebea98fcd654660e7e135f/Lib/subprocess.py#L891
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