Repository navigation
Conversation
sessionResultInstallSpanContexts found a result's closure-owning installs by walking dep edges upward from it through depParents. depParents spans every result built on the value in any session, so for a shared service the walk grew with everything ever built on it, and it ran on every exec that binds the service. Record each session's closure owners as they install, walk each owner's deps downward once on the next lookup, and answer lookups from that per-session index. The index is dropped with the session. Signed-off-by: Yasyf Mohamedali <yasyf@poetic.com>
This file contains hidden or 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
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.
Index closure-owning install spans per session instead of walking dep edges upward on every lookup.
sessionResultInstallSpanContextsfound closure owners by walkingdepParentsupward from the result being looked up.depParentsspans every result built on that value in any session, and the lookup runs on every exec that binds a service, so a service shared by many execs made each exec pay for everything already built on it. #15024 has the profile.This records each session's closure owners as they install, walks each owner's deps downward once on the next lookup, and answers lookups from that per-session index. The index is deleted with the session's other state in
cleanupReleasedSession.depParentsstays, since session-resource changes still cascade upward through it.Measured on one m8id.16xlarge engine, running a package of about 1,000 jest checks that each bind two services,
dagger check -j 48:One difference from the upward walk: an owner's deps are read once, on the first lookup after it installs. A dep attached to an owner after that lookup isn't attributed to it. I didn't hit that case, but I can re-queue an owner when its deps change if you think it matters.
Fixes #15024.