-
Notifications
You must be signed in to change notification settings - Fork 15
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
Allow self-referencing product blocks #112
Conversation
Codecov Report
@@ Coverage Diff @@
## main #112 +/- ##
==========================================
+ Coverage 83.02% 83.06% +0.04%
==========================================
Files 88 88
Lines 5018 5024 +6
Branches 830 832 +2
==========================================
+ Hits 4166 4173 +7
+ Misses 705 704 -1
Partials 147 147
Continue to review full report at Codecov.
|
c3c4d25
to
64840c2
Compare
Looks good 👍🏼 |
@@ -64,6 +64,14 @@ def get_thread_pool() -> ThreadPoolExecutor: | |||
return _workflow_executor | |||
|
|||
|
|||
def shutdown_thread_pool() -> None: |
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.
Is this only called in the tests?
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.
Yes, a testcase I added some time ago to test_processes.py
(for the resume-all endpoint) turned out to be flaky, as it didn't wait for async tasks to complete.
Adding shutdown_thread_pool()
function is the easiest solution for it - the alternative being to patch the threadpoolexecutor, capture .submit()
calls and calling .result()
on each return value..
I was thinking the threadpool shutdown could/should be used during FastAPI's shutdown, to prevent disconnecting from the DB before all async tasks have concluded. Which has a very small chance of happening, but who knows. :)
Closes #108 by using
get_type_hints()
which evaluates anyForwardRef
types to the actual type