Room disconnect issue fix#146
Draft
alan-george-lk wants to merge 6 commits into
Draft
Conversation
| msg->set_payload(*response_payload); | ||
| } | ||
| FfiClient::instance().sendRequest(req); | ||
| // This is invoked on the FFI listener thread; an unhandled throw here would |
Collaborator
There was a problem hiding this comment.
FMU why is this being added here?
Collaborator
Author
There was a problem hiding this comment.
This was a work around to avoid an integration test crash, I think this is a bad idea, still investigating
| try { | ||
| FfiClient::instance().disconnectAsync(handle->get(), reason).get(); | ||
| } catch (const std::exception& e) { | ||
| LK_LOG_ERROR("Room::disconnect: FFI disconnect failed: {}", e.what()); |
Collaborator
There was a problem hiding this comment.
in this case should we be setting connection_state_ back to the previous state?
Collaborator
Author
There was a problem hiding this comment.
Great catch -- fixing
The kEos RoomEvent handler moves out and destroys the local participant without first calling shutdown(). If the listener thread is mid-RPC- invocation when kEos arrives, the participant's FfiHandle is dropped while a handler is still in flight; the handler's later sendRequest then hits an invalid Rust handle and the uncaught std::runtime_error on the listener thread aborts the process. Mirror the ordering used in disconnect(): call shutdown() on the moved-out participant before letting it destruct. Add INFO-level tracing at the key lifecycle points (~Room, disconnect, kDisconnected, kEos, FfiHandle drops, INVALID_HANDLE error path) and DEBUG tracing on the RPC invocation hot path. Bump RUST_LOG in the integration-test CI step so the Rust side's "handle not found" error message lands in the log. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.