Skip to content

Commit

Permalink
BackupClientContext::CloseAnyOpenConnection: don't silently ignore er…
Browse files Browse the repository at this point in the history
…rors

Now that we can do significant writeback work during connection cleanup, it's
not appropriate to silently ignore and swallow errors. Really we should retry
this work, but I'm not yet sure what the best retry policy would be.
  • Loading branch information
qris committed Jul 9, 2018
1 parent 8a8bb81 commit e8d2676
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions lib/bbackupd/BackupClientContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,29 +182,31 @@ BackupProtocolCallable* BackupClientContext::GetOpenConnection() const
// --------------------------------------------------------------------------
void BackupClientContext::CloseAnyOpenConnection()
{
// Delete any pending list
if(mpDeleteList != 0)
{
delete mpDeleteList;
mpDeleteList = 0;
}

BackupProtocolCallable* pConnection(GetOpenConnection());
if(pConnection)
{
try
{
// Quit nicely
// Quit nicely:
pConnection->QueryFinished();
}
catch(...)
{
// Ignore errors here
// Close the connection anyway:
mapConnection.reset();
throw;
}

// Delete it anyway.
// Close the connection
mapConnection.reset();
}

// Delete any pending list
if(mpDeleteList != 0)
{
delete mpDeleteList;
mpDeleteList = 0;
}
}


Expand Down

0 comments on commit e8d2676

Please sign in to comment.