Make sure to always delete the remote serializer.

There were two problems actually: the iomanager wasn't properly
deleting sourcesl; and in some situations, the remote serialize wasn't
registered with it to begin with.

Addresses BIT-1306 and probably also BIT-1356.
This commit is contained in:
Robin Sommer 2015-04-10 17:27:28 -07:00
parent 1132470b05
commit 0620bc970a
5 changed files with 36 additions and 4 deletions

View file

@ -542,6 +542,9 @@ RemoteSerializer::RemoteSerializer()
current_msgtype = 0;
current_args = 0;
source_peer = 0;
// Register as a "dont-count" source first, we may change that later.
iosource_mgr->Register(this, true);
}
RemoteSerializer::~RemoteSerializer()
@ -571,8 +574,6 @@ void RemoteSerializer::Enable()
Fork();
iosource_mgr->Register(this);
Log(LogInfo, fmt("communication started, parent pid is %d, child pid is %d", getpid(), child_pid));
initialized = 1;
}
@ -612,6 +613,9 @@ void RemoteSerializer::Fork()
if ( child_pid )
return;
// Register as a "does-count" source now.
iosource_mgr->Register(this, false);
// If we are re-forking, remove old entries
loop_over_list(peers, i)
RemovePeer(peers[i]);