Skip to content

Commit eddd99c

Browse files
Fix deadlock in destruction of Eventstream Client (#632)
Co-authored-by: Bret Ambrose <[email protected]>
1 parent bd45be3 commit eddd99c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

eventstream_rpc/source/EventStreamClient.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,11 @@ namespace Aws
321321
{
322322
std::promise<RpcError> errorPromise;
323323
errorPromise.set_value({baseError, 0});
324+
if (baseError == EVENT_STREAM_RPC_NULL_PARAMETER)
325+
{
326+
const std::lock_guard<std::recursive_mutex> lock(m_stateMutex);
327+
m_clientState = DISCONNECTED;
328+
}
324329
return errorPromise.get_future();
325330
}
326331

@@ -353,6 +358,8 @@ namespace Aws
353358
"A CRT error occurred while attempting to establish the connection: %s",
354359
Crt::ErrorDebugString(crtError));
355360
errorPromise.set_value({EVENT_STREAM_RPC_CRT_ERROR, crtError});
361+
const std::lock_guard<std::recursive_mutex> lock(m_stateMutex);
362+
m_clientState = DISCONNECTED;
356363
return errorPromise.get_future();
357364
}
358365
else

0 commit comments

Comments
 (0)