Skip to content
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

Transfer - Graceful stop does not stop immediately #1005

Merged
merged 2 commits into from
Oct 22, 2023
Merged

Conversation

yahavi
Copy link
Member

@yahavi yahavi commented Oct 22, 2023

  • All tests passed. If this feature is not already covered by the tests, I added new tests.
  • All static analysis checks passed.
  • This pull request is on the dev branch.
  • I used gofmt for formatting the code before submitting the pull request.

Fix 2 issues in the Graceful Stop mechanism of jf rt transfer-files command:

  1. Create producerConsumerWrapper pointer in createTransferPhase to allow access it in StopGracefully:
func (pb *phaseBase) StopGracefully() {
	if pb.progressBar != nil {
		pb.progressBar.StopGracefully()
	}
	if pb.pcDetails != nil { // <- Was always nil
		pb.pcDetails.chunkBuilderProducerConsumer.Cancel(true)
		pb.pcDetails.chunkUploaderProducerConsumer.Cancel(true)
	}
}
  1. Since the Graceful stop mechanism is async and we poll interruptIfRequested every 20 seconds, there is a chance that more than 1 interruption signal will be sent to the "stopSignal" channel. This will cause the code to freeze.

@yahavi yahavi added the bug Something isn't working label Oct 22, 2023
@yahavi yahavi requested a review from eyalbe4 October 22, 2023 05:47
@yahavi yahavi self-assigned this Oct 22, 2023
@yahavi yahavi temporarily deployed to frogbot October 22, 2023 05:47 — with GitHub Actions Inactive
@github-actions
Copy link
Contributor


@yahavi yahavi merged commit eae9714 into jfrog:dev Oct 22, 2023
6 of 8 checks passed
@yahavi yahavi deleted the fix-stop2 branch October 22, 2023 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants