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

close Channel after stopping recv send queues #808

Merged
merged 1 commit into from
Aug 19, 2019

Conversation

fboucher67
Copy link
Contributor

@fboucher67 fboucher67 commented Aug 9, 2019

Channel is used by recv and send queues and possible blocked in I/O
operations. Closing the channel while it is still in use causes
problems with the recv and send queues and may cause problems in other
threads of the application.
Fixes #306.

Channel is used by recv and send queues and possible blocked in I/O
operations.  Closing the channel while it is still in use causes
problems with the recv and send queues and may cause problems in other
threads of the application.
@fboucher67
Copy link
Contributor Author

This is for issue #306

@maxsharabayko maxsharabayko added this to the v1.3.4 milestone Aug 9, 2019
@maxsharabayko maxsharabayko added the [core] Area: Changes in SRT library core label Aug 9, 2019
Copy link
Collaborator

@maxsharabayko maxsharabayko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m_pChannel->close() closes the system socket, while it might still be used somewhere.
A worker thread of the sender can be calling sendto on the channel. And there is no mutex around it. So nothing stops the channel to close the socket in another thread, causing the error.
Deleting both queues ensures the socket is not used anymore. Also the destructor of the sender calls m_pTimer->interrupt();, interrupting ongoing waits for the state changes.

@maxsharabayko maxsharabayko added the Type: Bug Indicates an unexpected problem or unintended behavior label Aug 12, 2019
@maxsharabayko maxsharabayko merged commit 553b24a into Haivision:master Aug 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UDP socket closed while still used by other threads
3 participants