Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix RPC invocation race condition #565

Merged
merged 8 commits into from
Feb 4, 2025
Merged

Fix RPC invocation race condition #565

merged 8 commits into from
Feb 4, 2025

Conversation

bcherry
Copy link
Contributor

@bcherry bcherry commented Feb 4, 2025

if your handler returned very quickly it was possible to send the invocation response back over FFI before the waiter was stored, resulting in error sending rpc method invocation response: No caller found on the handler side and a Response timeout on the caller side.

easy fix, and verified by running a test script in python with 100 calls to immediate-return handlers. in main i saw a failure rate of 11% and no errors at all with this branch. it didn't seem to matter whether the handlers were marked sync or not on the python side.

Copy link
Contributor

ilo-nanpa bot commented Feb 4, 2025

it seems like you haven't added any nanpa changeset files to this PR.

if this pull request includes changes to code, make sure to add a changeset, by writing a file to .nanpa/<unique-name>.kdl:

minor type="added" "Introduce frobnication algorithm"

refer to the manpage for more information.

@bcherry bcherry merged commit 7da4bc7 into main Feb 4, 2025
5 checks passed
@bcherry bcherry deleted the bcherry/rpc-invoke-race branch February 4, 2025 21:57
rileyseaburg pushed a commit to Evolving-Software/livekit-rust-sdks that referenced this pull request Feb 19, 2025
* Fix race condition in rpc invocation

* nanpa

* fix

* nanpa

* cgo

* sm
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants