Github user sarutak commented on the pull request:
https://github.com/apache/spark/pull/2019#issuecomment-53386362
In this PR, I want to resolve following issues.
(1) Race condition between a thread invoking ConnectionManager#stop and a
thread invoking threads invoking Connection#close
In this case, if a thread invoking ConnectionManager#stop evaluates
"connectionsByKey -= connection.key" in ConnectionManager#removeConnection()
after a thread invoking Connection#close evaluates k.cancel or channel.close in
Connection#close(), warning message "All connections not cleaned up" appears
because when evaluating "connectionsByKey -= connection.key", key is already
null.
(2) Race condition between a thread invoking SendingConnection#close and a
thread invoking SendingConnection#close after invoking ReceivingConnection#close
In this case, if a thread invoking ReceivingConnection#close evaluates
"!sendingConnectionOpt.isDefined" in ConnectionManager#removeConnection after a
thread invoking SendingConnection#close evaluates connectionsById -=
"sendingConnectionManagerId" in ConnectionManager#removeConnection,
"!sendingConnectionOpt.isDefined" is true and error message "Corresponding
SendingConnection to ${remoteConnectionManagerId} not found" appears.
(4) Race condition between a thread invoking ConnectionManager#run and
threads invoking Connection#close
In this case, if a thread invoking ConnectionManager#run evaluates "!
key.invalid", after threads invoking Connection#close evaluates key.cancel, "!
key.invalid" is true and error message related to CancelledKeyException appears.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]