Skip to content

Conversation

@karajan1001
Copy link
Contributor

@karajan1001 karajan1001 commented Dec 5, 2022

fix: #8624

  1. Add a new flag --force for queue kill
  2. Make SIGINT to be the default option and SIGKILL to be with --force
  3. Remove SIGINT blocking.
  4. Add tests for queue kill

wait for treeverse/dvc-task#101

Thank you for the contribution - we'll try to review it as soon as possible. 🙏

@karajan1001 karajan1001 added enhancement Enhances DVC A: experiments Related to dvc exp A: task-queue labels Dec 5, 2022
@karajan1001 karajan1001 requested a review from pmrowla December 5, 2022 03:41
@karajan1001 karajan1001 self-assigned this Dec 5, 2022
@codecov
Copy link

codecov bot commented Dec 5, 2022

Codecov Report

Base: 93.50% // Head: 93.50% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (268360c) compared to base (5f0b1ed).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8657   +/-   ##
=======================================
  Coverage   93.50%   93.50%           
=======================================
  Files         457      457           
  Lines       36203    36207    +4     
  Branches     5244     5246    +2     
=======================================
+ Hits        33850    33854    +4     
  Misses       1845     1845           
  Partials      508      508           
Impacted Files Coverage Δ
dvc/commands/queue/kill.py 100.00% <100.00%> (ø)
dvc/repo/experiments/queue/celery.py 85.49% <100.00%> (+0.11%) ⬆️
dvc/stage/run.py 94.04% <100.00%> (ø)
tests/unit/command/test_queue.py 100.00% <100.00%> (ø)
tests/unit/repo/experiments/queue/test_celery.py 96.42% <100.00%> (+0.03%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@karajan1001 karajan1001 force-pushed the fix8624 branch 2 times, most recently from bc0ea4e to 19f98f5 Compare December 8, 2022 13:33
@pmrowla
Copy link
Contributor

pmrowla commented Dec 9, 2022

@karajan1001 there's merge conflicts in this PR, CI can't run until it's fixed

@karajan1001 karajan1001 changed the title [WIP] Use SIGINT as the default signal in queue kill Use SIGINT as the default signal in queue kill Dec 10, 2022
Copy link
Contributor

@pmrowla pmrowla left a comment

Choose a reason for hiding this comment

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

This LGTM, pending @dberenbaum review of the help/usage messages

@dberenbaum
Copy link
Contributor

When I run dvc queue kill using https://github.com/iterative/vscode-dvc-demo, it hangs and prints an error in the terminal like:

$ Process _DaemonProcess-1:
Traceback (most recent call last):
  File "/Users/dave/miniforge3/envs/torch/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/Users/dave/miniforge3/envs/torch/lib/python3.10/site-packages/dvc_task/proc/process.py", line 232, in run
    super().run()
  File "/Users/dave/miniforge3/envs/torch/lib/python3.10/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/dave/miniforge3/envs/torch/lib/python3.10/site-packages/dvc_task/proc/process.py", line 224, in _spawn
    with cls(*args, **kwargs):
  File "/Users/dave/miniforge3/envs/torch/lib/python3.10/site-packages/dvc_task/proc/process.py", line 103, in __exit__
    self.wait()
  File "/Users/dave/miniforge3/envs/torch/lib/python3.10/site-packages/dvc_task/proc/process.py", line 196, in wait
    self._proc.wait(timeout=timeout)
  File "/Users/dave/miniforge3/envs/torch/lib/python3.10/subprocess.py", line 1207, in wait
    return self._wait(timeout=timeout)
  File "/Users/dave/miniforge3/envs/torch/lib/python3.10/subprocess.py", line 1941, in _wait
    (pid, sts) = self._try_wait(0)
  File "/Users/dave/miniforge3/envs/torch/lib/python3.10/subprocess.py", line 1899, in _try_wait
    (pid, sts) = os.waitpid(self.pid, wait_flags)
KeyboardInterrupt

@karajan1001
Copy link
Contributor Author

When I run dvc queue kill using https://github.com/iterative/vscode-dvc-demo, it hangs and prints an error in the terminal like:

$ Process _DaemonProcess-1:
Traceback (most recent call last):
  File "/Users/dave/miniforge3/envs/torch/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/Users/dave/miniforge3/envs/torch/lib/python3.10/site-packages/dvc_task/proc/process.py", line 232, in run
    super().run()
  File "/Users/dave/miniforge3/envs/torch/lib/python3.10/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/dave/miniforge3/envs/torch/lib/python3.10/site-packages/dvc_task/proc/process.py", line 224, in _spawn
    with cls(*args, **kwargs):
  File "/Users/dave/miniforge3/envs/torch/lib/python3.10/site-packages/dvc_task/proc/process.py", line 103, in __exit__
    self.wait()
  File "/Users/dave/miniforge3/envs/torch/lib/python3.10/site-packages/dvc_task/proc/process.py", line 196, in wait
    self._proc.wait(timeout=timeout)
  File "/Users/dave/miniforge3/envs/torch/lib/python3.10/subprocess.py", line 1207, in wait
    return self._wait(timeout=timeout)
  File "/Users/dave/miniforge3/envs/torch/lib/python3.10/subprocess.py", line 1941, in _wait
    (pid, sts) = self._try_wait(0)
  File "/Users/dave/miniforge3/envs/torch/lib/python3.10/subprocess.py", line 1899, in _try_wait
    (pid, sts) = os.waitpid(self.pid, wait_flags)
KeyboardInterrupt

Need to suppress this error message in dvc-task, treeverse/dvc-task#103

Comment on lines +82 to -89
old_handler = None

exec_cmd = _make_cmd(executable, cmd)
old_handler = None
Copy link
Contributor

Choose a reason for hiding this comment

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

@karajan1001 What is this change about?

Copy link
Contributor

Choose a reason for hiding this comment

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

@karajan1001 If you can explain this change, I'm happy to approve. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually not anything affected by this. I will undo this.

@dberenbaum
Copy link
Contributor

@karajan1001 Since it's a small change and @pmrowla is away, I'm happy to review this one (or you could ask someone else on the team). LGTM except for one minor question.

@karajan1001
Copy link
Contributor Author

@karajan1001 Since it's a small change and @pmrowla is away, I'm happy to review this one (or you could ask someone else on the team). LGTM except for one minor question.

@pmrowla had already approved it, we can focus on documents reviewing.

@dberenbaum
Copy link
Contributor

Thanks @karajan1001! The help messages look good. See the one question I had in this PR.

@dberenbaum dberenbaum added p2-medium Medium priority, should be done, but less important and removed p2-medium Medium priority, should be done, but less important labels Dec 20, 2022
@pmrowla
Copy link
Contributor

pmrowla commented Dec 27, 2022

@karajan1001 this has conflicts w/the queue stop --kill PR that was merged

fix: treeverse#8624
1. Add a new flag `--force` for `queue kill`
2. Make `SIGINT` to be the default option and `SIGKILL` to be with
   `--force`
3. Add tests for `queue kill`
4. Bump dvc-task into 0.1.9
@karajan1001 karajan1001 merged commit 06673dd into treeverse:main Dec 30, 2022
@karajan1001 karajan1001 deleted the fix8624 branch December 30, 2022 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A: experiments Related to dvc exp enhancement Enhances DVC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

queue: Ability to send different signals to running tasks

3 participants