|
In both _scheduleMemberHeartbeatToTarget and _doMemberHeartbeat, the handles returned by scheduleWorkAt and scheduleRemoteCommand are tracked by _trackHeartbeatHandle.
The behavior of ReplicationExecutor::scheduleRemoteCommand is specified by the TaskExecutor interface as:
/**
|
* Schedules "cb" to be run by the executor with the result of executing the remote command
|
* described by "request".
|
*
|
* Returns a handle for waiting on or canceling the callback, or
|
* ErrorCodes::ShutdownInProgress.
|
*
|
* May be called by client threads or callbacks running in the executor.
|
*/
|
virtual StatusWith<CallbackHandle> scheduleWorkAt(Date_t when, const CallbackFn& work) = 0;
|
|
and ReplicationExecutor::scheduleWorkAt
/**
|
* Schedules "work" to be run by the executor no sooner than "when".
|
*
|
* Returns a handle for waiting on or canceling the callback, or
|
* ErrorCodes::ShutdownInProgress.
|
*
|
* May be called by client threads or callbacks running in the executor.
|
*/
|
virtual StatusWith<CallbackHandle> scheduleRemoteCommand(const RemoteCommandRequest& request, const RemoteCommandCallbackFn& cb) = 0;
|
We cancel heartbeats by calling cancel on the handles returned by these functions in _cancelHeartbeats_inlock. If these cancel operations do not behave the way they are specified by the TaskExecutor interface, that should be marked as an issue with with the ReplicationExecutor implementation. The tracking of all heartbeat handles seems to be done correctly, however, at the ReplicationCoordinator layer.
|
|
After investigating this, it is unclear what this ticket is referring to. The network operation's handle is tracked here and then cancelled when a user calls cancel. Following through the callbacks, it seems all of the handles are tracked and untracked correctly and all are done under the _topoMutex. I think _cancelHeartbeats_inlock() is called without the _topoMutex being held here which could be a problem, but that's not what this ticket is referring to.
I'm putting this back on the backlog for future investigation.
|