IceAgent partial timerqueue shutdown fix and the turnconnection sending data after shutdown#2053
Conversation
| // Shutdown all the timers during iceAgentShutdown; do not partially shut down timers. | ||
| if (pIceAgent->iceAgentStateTimerTask != MAX_UINT32) { | ||
| CHK_STATUS(timerQueueCancelTimer(pIceAgent->timerQueueHandle, pIceAgent->iceAgentStateTimerTask, (UINT64) pIceAgent)); | ||
| CHK_LOG_ERR(timerQueueCancelTimer(pIceAgent->timerQueueHandle, pIceAgent->iceAgentStateTimerTask, (UINT64) pIceAgent)); |
There was a problem hiding this comment.
This is good so we do not abort trying to cancel the other timers. However you should also set the retStatus so the overall function can still return the ERROR status to the caller to notify it that the iceAgentShutdown operation did not fully succeed.
Perhaps something like this:
retStatus = timerQueueCancelTimer(pIceAgent->timerQueueHandle, pIceAgent->iceAgentStateTimerTask, (UINT64) pIceAgent));
CHK_LOG_ERR(retStatus);
Note that CHK_LOG_ERR is a no-op if the retStatus passed to it is a STATUS_SUCCESS.
There was a problem hiding this comment.
One adjustment to that suggestion is that we'll also need to not set the status back to a success after something took too long, so an additional check will be needed.
There was a problem hiding this comment.
1/ If it fails to cancel timer, then what action we are taking? 2/ Considering these three changes which are well within If block and in a shutdown function. Do we need either CHK_STATUS or CHK_LOG_ERR? 3/ CHK_LOG_ERR will print error log. Customers often take this message as an error in a state machine causing them confusion
|
|
||
| CHK(pTurnConnection != NULL && pDestIp != NULL, STATUS_NULL_ARG); | ||
| CHK(pBuf != NULL && bufLen > 0, STATUS_INVALID_ARG); | ||
| CHK(!ATOMIC_LOAD_BOOL(&pTurnConnection->stopTurnConnection), STATUS_SUCCESS); // Do not send data after stop |
|
This is a very old issue. We encourage you to check if this is still an issue in the latest release and if you find that this is still a problem, please feel free to open a new one. |
What was changed?*
Why was it changed?
How was it changed?
What testing was done for the changes?
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.