Correctly clean up progress bars for completed transfers#2975
Merged
Conversation
1603c7d to
53fc32c
Compare
Contributor
Author
|
@patrickbrophy You get this one because you mentioned some tool might have observed a problem with our progress bars. |
Contributor
Author
|
In the graph above, I believe the extreme downward spikes are correlated with when the client needed to perform another listing ( |
patrickbrophy
suggested changes
Jan 15, 2026
patrickbrophy
left a comment
Contributor
There was a problem hiding this comment.
The fix does directly address the cause, however the semantics on the RWLock are now incorrect. Very minor change requested, otherwise LGTM
The user might not have seen them in the console, but the client was still spending an inordinate amount of resources on them.
53fc32c to
3571a0f
Compare
Contributor
Author
|
I rebased this on |
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.
Summary
A
pelican object syncorpelican object get --recursiveinvolving hundreds of thousands of objects will no longer degrade in performance, as in transfer fewer and fewer objects per unit time, when progress bars are enabled (which is the default).As a consequence, users might notice that progress bars are no longer displayed at all for transfers that complete under ~0.5 seconds.
Note
There is the potential for a pathological scenario where no progress bars are displayed because all transfers are starting and completing too quickly. The solution for that is to implement an overall status indicator — for example, number of objects transferred out of total number to be transferred — which is out of the scope for this PR.
Details
The linked issue contains a test bench that can be used to verify the fix in this PR, as well as the raw data for the graph below.
The linked issue also contains evidence implicating that the client's handling of progress bars is at fault.
The primary loop is over
pb.status:pelican/cmd/progress_bars.go
Lines 112 to 114 in 088217e
This map is populated via a callback from the transfer jobs, and keyed by the paths of the objects being transferred.
The fundamental problem is we never remove keys from
pb.status, so long after the transfer for a path has completed and the progress bar has been removed from the display, we're still updating it:pelican/cmd/progress_bars.go
Lines 135 to 136 in 088217e
The whole business around setting
pbMap[path].xfer = -1should be clearing out progress bars for completed transfers. We need only delete keys frompb.statusas appropriate, so that the logic there actually plays out as intended.And indeed, once we do so, we get a more reasonable behavior:
I would post screenshots of the relevant visualizations from pprof, but I can't find anything significant related to the progress bars anymore, which would suggest that it's below the threshold for caring about.