-
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
Close #9: Support multiple concurrent worker processes #20
Conversation
Codecov Report
@@ Coverage Diff @@
## main #20 +/- ##
===========================================
- Coverage 97.90% 59.85% -38.05%
===========================================
Files 6 9 +3
Lines 143 274 +131
===========================================
+ Hits 140 164 +24
- Misses 3 110 +107
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
69ebdc7
to
ea32f3c
Compare
Features: * Accept --concurrency N option and spawn N workers * Wait for child workers ready before propagate msg * Ensure worker exit early with message when app path invalid * Make parallel requests when checking for ready workers Dev features & tech debts: * Ensure run some tests asynchronously * Remove unnecessary GithubAction workflow * Add docstrings to some modules, classes and functions * Cleanup using pylint and black (Will add pylint to CI in the future) * Allow specify test pattern on ./test.sh Notes: Currently we see this warning when running the tests: ``` Task was destroyed but it is pending! task: <Task pending name='Task-5' coro=<Connection.disconnect()\ done, defined at /home/in-gote/workspace/aiotaskq/.venv/lib/\ python3.10/site-packages/aioredis/connection.py:794> wait_for=<\ Future pending cb=[Task.task_wakeup()]>> ``` We should fix it in the future. Also, currently because in some tests (e.g. `test_integration.test_sync_and_async_parity__simple_app`) we're starting the worker in a sub-process, `coverage` doesn't count anything in worker.py. I tried following this guide: https:// coverage.readthedocs.io/en/6.4.4/api_module.html#coverage.process _startup, but I couldn't get it to work. Maybe I missed something. We also need to fix this in the future. We should consider either: 1. Start the worker using `multiprocessing` instead of `subprocess` 2. Somehow follow the guide correctly
ea32f3c
to
07e0de6
Compare
Also, delint & add more docstring.
@cglotr I've applied the requested changes, and also added some more docstrings & delinting. Please review the last two commits when you have time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm but added a new comment
Features:
Dev features & tech debts:
Notes:
Currently we see this warning when running the tests:
We should fix it in the future.
Also, currently because in some tests (e.g.
test_integration.test_sync_and_async_parity__simple_app
) we'restarting the worker in a sub-process,
coverage
doesn't countanything in worker.py. I tried following this guide, but I couldn't get it to work. Maybe I missed something.
We also need to fix this in the future. We should consider either:
multiprocessing
instead ofsubprocess