-
-
Notifications
You must be signed in to change notification settings - Fork 643
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
The anonymous-telemetry subsystem ~doubles Pants no-op latency when non-async callbacks are enabled. #11833
Comments
There is a tangle of issues making this slow. Even though we mark the anonymous telemetry workunit callback as having an async finish: pants/src/python/pants/goal/anonymous_telemetry.py Lines 81 to 84 in 2b412db
We still block on workunit callback completion since there are other callbacks in the system - not all capable of async finish: pants/src/python/pants/engine/streaming_workunit_handler.py Lines 273 to 274 in e64cf31
pants/src/python/pants/engine/streaming_workunit_handler.py Lines 241 to 245 in e64cf31
That aside, the anonymous telemetry callback is not actually asynchronous anyhow since: pants/src/python/pants/goal/anonymous_telemetry.py Lines 141 to 143 in 2b412db
Some added timing measurement shows this join takes ~550ms with telemetry turned on. |
Are you using BuildSense / Toolchain plugin? If so, that is currently not async, so you are right that it will cause this to be sync. I use this to disable the plugin: export PANTS_VERIFY_CONFIG=false
export PANTS_PLUGINS="-['toolchain.pants.plugin==0.7.0']"
export PANTS_BACKEND_PACKAGES="-['toolchain.pants.auth', 'toolchain.pants.buildsense', 'toolchain.pants.common']" |
No. See the hyperfine, but the slowdown is isolated with just toggling the |
And - there is plenty more than the tc plugin in our WorkunitCallback list that is not async. |
Yes, but whether BuildSense is enabled impacts if
Nack, the only other one should be -- It would be good to try this again with BuildSense disabled to see the impact when it can complete async. We knew it would impact non-async times - the more important case is when async is possible. |
OK. What you say appears to be true. I am using BuildSense since these are measurements in the Pants repo where that is enabled. So I think my conclusion and this bug still stand. I'll highlight from the tangle I pointed out above: pants/src/python/pants/engine/streaming_workunit_handler.py Lines 241 to 245 in e64cf31
That TODO is on-target. Not having it implemented has this real-world impact. |
Agreed. Although note that the upcoming Toolchain plugin is marked async, so this won't be a problem then. |
#11618 is fixed (and I'll cherrypick it to It's possible that when that lands we should close this ticket, and open a new one for the TODO above. |
When running in CI, and a particular check fails (lint/typecheck) the pants process exits when a non-zero exist code, which causes CI to kill the container and not allowing pantsd to continue to run and allow plugins to complete async. |
… by default in containers (#12392) When run inside of a container that exits as soon as the client returns, async completion of workunit handlers can lead to loss of metrics. Since async completion has significant performance benefits, we disable it conditionally based on whether it is likely that we are running inside of a container. Fixes #11833. [ci skip-rust]
… by default in containers (pantsbuild#12392) When run inside of a container that exits as soon as the client returns, async completion of workunit handlers can lead to loss of metrics. Since async completion has significant performance benefits, we disable it conditionally based on whether it is likely that we are running inside of a container. Fixes pantsbuild#11833. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
… by default in containers (pantsbuild#12392) When run inside of a container that exits as soon as the client returns, async completion of workunit handlers can lead to loss of metrics. Since async completion has significant performance benefits, we disable it conditionally based on whether it is likely that we are running inside of a container. Fixes pantsbuild#11833. [ci skip-rust]
… by default in containers (Cherry-pick of #12392) (#12398) When run inside of a container that exits as soon as the client returns, async completion of workunit handlers can lead to loss of metrics. Since async completion has significant performance benefits, we disable it conditionally based on whether it is likely that we are running inside of a container. Fixes #11833. [ci skip-rust] [ci skip-build-wheels]
… by default in containers (Cherry-pick of #12392) (#12399) When run inside of a container that exits as soon as the client returns, async completion of workunit handlers can lead to loss of metrics. Since async completion has significant performance benefits, we disable it conditionally based on whether it is likely that we are running inside of a container. Fixes #11833. [ci skip-rust] [ci skip-build-wheels]
Since user and system times did not budge, this is all IO latency.
The text was updated successfully, but these errors were encountered: