Remove cache in iscoroutinefunction to avoid holding on to refs#5985
Conversation
|
Fine by me. If we need it in the future we can cache by function name or something else. Happy to wait until it's proven necessary though and proceed optimistically. |
|
I was hoping this would also avoid: https://github.com/dask/distributed/runs/5661844951?check_suite_focus=true#step:12:1348 |
Unit Test Results 12 files + 12 12 suites +12 6h 0m 54s ⏱️ + 6h 0m 54s For more details on these errors, see this check. Results for commit 3ef2f5c. ± Comparison against base commit b872d45. |
@graingert I just came across this as well. Do you know if this is something to be concerned with or is there another issue that references this? |
This is currently suspected to be one of the reasons why our CI is behaving very awkwardly, e.g. why sometimes GC takes so long to run. We couldn't prove this but we know for a fact that this causes problems by accumulating DequeHandlers, see #5973
I believe we should find a method which does not hold on to references if we indeed want to cache this. However, introducing any mechanic in here that would ensure us not holding on to references is likely much slower than simply using the inspect call.
The cache was introduced in #4481 and basically reverts #4469
We don't have any benchmarks about this I could run to verify the impact. Generally, I'm very surprised to see this taking so long. Based on a microbenchmark this is very fast