Skip to content

backup: Fix shutdown hang when running in the background on linux#3152

Merged
fd0 merged 1 commit intorestic:masterfrom
MichaelEischer:fix-backup-background-hang
Dec 6, 2020
Merged

backup: Fix shutdown hang when running in the background on linux#3152
fd0 merged 1 commit intorestic:masterfrom
MichaelEischer:fix-backup-background-hang

Conversation

@MichaelEischer
Copy link
Copy Markdown
Member

What does this PR change? What problem does it solve?

On Linux, during shutdown the backup commands waits for the terminal output goroutine to stop. However while running in the background that goroutine ignored the canceled context.

This PR lets the goroutine exit instead.

Was the change discussed in an issue or in the forum before?

The hang was reported in the forum https://forum.restic.net/t/restic-alpine-container-cron-hangs-epoll-pwait/3334 .

Checklist

  • I have read the Contribution Guidelines
  • I have enabled maintainer edits for this PR
  • [ ] I have added tests for all changes in this PR Tested manually.
  • [ ] I have added documentation for the changes (in the manual)
  • There's a new file in changelog/unreleased/ that describes the changes for our users (template here)
  • I have run gofmt on the code in all commits
  • All commit messages are formatted in the same style as the other commits in the repo
  • I'm done, this Pull Request is ready for review

On shutdown the backup commands waits for the terminal output goroutine
to stop. However while running in the background the goroutine ignored
the canceled context.
@MichaelEischer MichaelEischer force-pushed the fix-backup-background-hang branch from 5b27d49 to 401ef92 Compare December 6, 2020 17:53
Copy link
Copy Markdown
Member

@fd0 fd0 left a comment

Choose a reason for hiding this comment

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

LGTM!

@fd0 fd0 merged commit b58799d into restic:master Dec 6, 2020
@MichaelEischer MichaelEischer deleted the fix-backup-background-hang branch December 13, 2020 18:57
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