Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

RTCPeerConnection::close no longer returns a Send future #413

Closed
thomaseizinger opened this issue Feb 27, 2023 · 5 comments
Closed

RTCPeerConnection::close no longer returns a Send future #413

thomaseizinger opened this issue Feb 27, 2023 · 5 comments

Comments

@thomaseizinger
Copy link
Contributor

I am not sure if this change was on purpose, but in the latest release, the RTCPeerConnection::close function returns a future that is no longer Send which effectively makes this unusable with most executors that send tasks between worker threads.

See https://github.com/libp2p/rust-libp2p/actions/runs/4280630599/jobs/7453106193 for an example compile output.

The underlying issue seems to be that RTCRtpTransceiver::stop holds a mutex lock across an await point. Is that Mutex even necessary? None of the functions within RTCRtpTransceiver take &mut self so you should be fine without the Mutex?

@kolserdav
Copy link
Contributor

Maybe this is related to this issue #422

@thomaseizinger
Copy link
Contributor Author

Maybe this is related to this issue #422

It seems related yes. #422 was closed though. Did a fix land in master for this?

@kolserdav
Copy link
Contributor

kolserdav commented Mar 29, 2023

Maybe this is related to this issue #422

It seems related yes. #422 was closed though. Did a fix land in master for this?

No, it's still in progress #429 , now I've reopened it.

@thomaseizinger
Copy link
Contributor Author

To avoid this in the future, it might be worth looking at activating the following clippy lint: https://rust-lang.github.io/rust-clippy/master/#future_not_send

@thomaseizinger
Copy link
Contributor Author

Fixed by #429.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants