-
Notifications
You must be signed in to change notification settings - Fork 1
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
Blocked detector #5
Closed
Closed
Conversation
This file contains 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
most attributes are tied to Task
def BLOCKING_DISK_IO(the_broker) -> xyzabc.task.Task:
class BlockingDiskIOTask(xyzabc.task.Task):
async def async_run(self, *args, **kwargs):
print()
print("RUNNING BlockingDiskIOTask:")
import subprocess
subprocess.run(["dd", "if=/dev/zero", "of=/dev/null", "bs=500000", "count=1000000"])
task = BlockingDiskIOTask(
the_broker=the_broker,
queue_name="BlockingDiskIOTask",
eta=60.0,
retries=3,
log_id="myLogID",
hook_metadata='{"email": "example@example.com"}',
)
return task |
For the blocking disk IO task above, the TaskBlocker Watchdog generates this stack trace: File "cli/cli.py", line 327, in <module>
asyncio.run(async_main(), debug=True)
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 555, in run_until_complete
self.run_forever()
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 523, in run_forever
self._run_once()
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 1750, in _run_once
handle._run()
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/Users/komuw/mystuff/xyzabc/xyzabc/worker.py", line 222, in consume_forever
await self.run(*task_args, **task_kwargs)
File "/Users/komuw/mystuff/xyzabc/xyzabc/worker.py", line 123, in run
return_value = await self.the_task.async_run(*task_args, **task_kwargs)
File "cli/cli.py", line 79, in async_run
subprocess.run(["dd", "if=/dev/zero", "of=/dev/null", "bs=500000", "count=1000000"])
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 455, in run
stdout, stderr = process.communicate(input, timeout=timeout)
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 912, in communicate
self.wait()
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 971, in wait
return self._wait(timeout=timeout)
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1601, in _wait
(pid, sts) = self._try_wait(0)
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1559, in _try_wait
(pid, sts) = os.waitpid(self.pid, wait_flags) |
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.
Thank you for contributing to xyzabc.
Every contribution to xyzabc is important.
Contributor offers to license certain software (a “Contribution” or multiple
“Contributions”) to xyzabc, and xyzabc agrees to accept said Contributions,
under the terms of the MIT License.
Contributor understands and agrees that xyzabc shall have the irrevocable and perpetual right to make
and distribute copies of any Contribution, as well as to create and distribute collective works and
derivative works of any Contribution, under the MIT License.
Now,
What(What have you changed?)
Why(Why did you change it?)
Task.async_run
is not blocking #4References: