Skip to content

Commit 13e1e9b

Browse files
committed
Add detach replica in shutdown function when error occurs during apply segment of journal
1 parent 54d538c commit 13e1e9b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/remote/server/ReplServer.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,12 @@ namespace
416416

417417
void shutdown()
418418
{
419+
FbLocalStatus localStatus;
420+
if (m_replicator.hasData())
421+
m_replicator->close(&localStatus);
419422
m_replicator = nullptr;
423+
if (m_attachment.hasData())
424+
m_attachment->detach(&localStatus);
420425
m_attachment = nullptr;
421426
m_sequence = 0;
422427
m_connected = false;
@@ -437,7 +442,7 @@ namespace
437442

438443
bool isShutdown() const
439444
{
440-
return (m_attachment == NULL);
445+
return (m_attachment == nullptr);
441446
}
442447

443448
const PathName& getDirectory() const

0 commit comments

Comments
 (0)