mirror of https://github.com/citusdata/citus.git
Fix worker crash when coordinator disconnects
parent
73e1d81bb3
commit
667280650d
|
@ -48,6 +48,9 @@ RedirectCopyDataToRegularFile(const char *filename)
|
|||
|
||||
fileDesc = FileOpenForTransmit(filename, fileFlags, fileMode);
|
||||
|
||||
PG_TRY();
|
||||
{
|
||||
|
||||
SendCopyInStart();
|
||||
|
||||
copyDone = ReceiveCopyData(copyData);
|
||||
|
@ -73,6 +76,14 @@ RedirectCopyDataToRegularFile(const char *filename)
|
|||
resetStringInfo(copyData);
|
||||
copyDone = ReceiveCopyData(copyData);
|
||||
}
|
||||
}
|
||||
PG_CATCH();
|
||||
{
|
||||
FreeStringInfo(copyData);
|
||||
FileClose(fileDesc);
|
||||
PG_RE_THROW();
|
||||
}
|
||||
PG_END_TRY();
|
||||
|
||||
FreeStringInfo(copyData);
|
||||
FileClose(fileDesc);
|
||||
|
|
Loading…
Reference in New Issue