Switch to TMPDIR before initiating SSH multiplexing workaround to prevent locking the destination filesystem#348
Merged
Conversation
This prevents SSH multiplexing holding a lock on the backup directory which may be an NFS mount.
dbussink
reviewed
Oct 26, 2017
| opts="-o ControlMaster=auto -o ControlPath=\"$controlpath\" -o ControlPersist=10m -o ServerAliveInterval=10 $opts" | ||
| # Workaround for https://bugzilla.mindrot.org/show_bug.cgi?id=1988 | ||
| [ -S $controlpath ] || ssh -f -p $port $opts -o BatchMode=yes "$host" -- /bin/true 1>/dev/null 2>&1 || true | ||
| if ! [ -S $controlpath ]; then |
Contributor
There was a problem hiding this comment.
Should we run the cd in a subshell so the working directory is not changed for the script itself? That side effect might trip up people in the future otherwise.
dbussink
approved these changes
Oct 26, 2017
Merged
JoeFranks1993
pushed a commit
that referenced
this pull request
Jun 29, 2023
…ackup_0 Allow the caller to handle setting failures
Merged
bonsohi
pushed a commit
that referenced
this pull request
Jul 4, 2023
…ackup_0 Allow the caller to handle setting failures
dooleydevin
pushed a commit
that referenced
this pull request
Jul 14, 2023
…ackup_0 Allow the caller to handle setting failures
dooleydevin
pushed a commit
that referenced
this pull request
Jul 21, 2023
…ackup_0 Allow the caller to handle setting failures
dooleydevin
pushed a commit
that referenced
this pull request
Jul 21, 2023
dooleydevin
pushed a commit
that referenced
this pull request
Jul 21, 2023
…ackup_0 Allow the caller to handle setting failures
This was referenced Jul 21, 2023
Merged
Merged
Merged
Merged
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.
As identified in https://github.com/github/backup-utils/issues/345, if we don't switch to
$TMPDIRbefore working around the OpenSSH bug, we end up holding a file handle open on the backup directory until such time as the master connection timeout has been reached (10mins). This poses a problem if the backup directory is an NFS mount that needs to be umounted when the backup has finished.Fixes https://github.com/github/backup-utils/issues/345
🎩 tip to @zmedico for the fix.
/cc @github/backup-utils