Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

progress: removed the progress struct #561

Merged
merged 5 commits into from
Oct 23, 2020

Conversation

YuJuncen
Copy link
Collaborator

@YuJuncen YuJuncen commented Oct 21, 2020

What problem does this PR solve?

remove the progress struct.
This struct was error-prone(It has multi send-part but only close once, hence may leading tosend on closed channel), hence we embedded its function to an atomic integer in ProgressPrinter.

What is changed and how it works?

Remove the struct glue.progress, implement glue.Progress for ProgressPrinter directly.
This may cause the progress value won't immediately be added when calling Inc. But we update the progress status by polling the progress every second, it would be ok to not react immediately.

Check List

Tests

  • Unit test

Release Note

  • No release note.

pkg/utils/progress.go Outdated Show resolved Hide resolved
pkg/utils/progress.go Show resolved Hide resolved
@YuJuncen
Copy link
Collaborator Author

/run-integration-test

1 similar comment
@YuJuncen
Copy link
Collaborator Author

/run-integration-test

@YuJuncen
Copy link
Collaborator Author

Operation: [get] for kind: [Pod] with name: [br-test-go1130-1hk2t-xkcn3] in namespace: [jenkins-ci] failed. 🤔

/run-integration-test

@kennytm
Copy link
Collaborator

kennytm commented Oct 21, 2020

/run-integration-test

@YuJuncen
Copy link
Collaborator Author

/build

....

@kennytm
Copy link
Collaborator

kennytm commented Oct 22, 2020

/build

@YuJuncen
Copy link
Collaborator Author

/run-integration-test

@YuJuncen
Copy link
Collaborator Author

/run-integration-test

default not found? 🤔

@overvenus
Copy link
Member

/run-integration-test

default not found? 🤔

@YuJuncen Do you have a link to the error? It may be a bug and indicates data loss.

@YuJuncen
Copy link
Collaborator Author

/run-integration-test

Copy link
Collaborator

@kennytm kennytm left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added the status/LGT1 LGTM1 label Oct 23, 2020
Copy link
Collaborator

@3pointer 3pointer left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot removed the status/LGT1 LGTM1 label Oct 23, 2020
@ti-srebot ti-srebot added the status/LGT2 LGTM2 label Oct 23, 2020
@YuJuncen YuJuncen merged commit d583a63 into pingcap:master Oct 23, 2020
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #564

3pointer pushed a commit that referenced this pull request Oct 23, 2020
* progress: removed the progress struct

* progress: added a guard for cancel

* progress: remove atomic adder

Co-authored-by: hillium <yujuncen@pingcap.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants