Skip to content

fix: fix progress bar stuck when error occurred during pull/push#65

Merged
gaius-qi merged 1 commit intomainfrom
fix/pb-stuck
Feb 10, 2025
Merged

fix: fix progress bar stuck when error occurred during pull/push#65
gaius-qi merged 1 commit intomainfrom
fix/pb-stuck

Conversation

@chlins
Copy link
Member

@chlins chlins commented Feb 10, 2025

This pull request introduces an Abort method to the ProgressBar class and integrates it into various error handling scenarios within the pullIfNotExist and pushIfNotExist functions. The most important changes include the addition of the Abort method and its usage to handle errors more gracefully by aborting the progress bar when an error occurs.

Enhancements to error handling:

  • pkg/backend/progress.go: Added a new Abort method to the ProgressBar class to abort the progress bar for a given descriptor.

Integration of the Abort method in error scenarios:

  • pkg/backend/pull.go: Updated the pullIfNotExist function to call pb.Abort(desc) when reading the manifest fails.
  • pkg/backend/pull.go: Updated the pullIfNotExist function to call pb.Abort(desc) when pushing a blob fails.
  • pkg/backend/push.go: Updated the pushIfNotExist function to call pb.Abort(desc) when pushing the manifest fails.
  • pkg/backend/push.go: Updated the pushIfNotExist function to call pb.Abort(desc) when pushing a blob fails.

Signed-off-by: chlins <chlins.zhang@gmail.com>
Copy link
Member

@gaius-qi gaius-qi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gaius-qi gaius-qi merged commit db1763c into main Feb 10, 2025
5 checks passed
@gaius-qi gaius-qi deleted the fix/pb-stuck branch February 10, 2025 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants