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

WIP: Use usrsctp only from dedicated single thread. #1261

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mstyura
Copy link
Contributor

@mstyura mstyura commented May 16, 2020

This PR moves calling usrsctp API into dedicated single thread to reduce chances of multi-threading issues.
When usrsctp is itself updated to the version which has support of disabling internal SCTP Timer thread then usrsctp will not be used concurrently at all.

@mstyura mstyura changed the title WIP: Use usrsctp only from deidcated single thread. WIP: Use usrsctp only from dedicated single thread. May 16, 2020
@bbaldino
Copy link
Member

bbaldino commented May 18, 2020

Did you run into an issue with the SCTP threading that prompted this?

// Leave SCTP thread ASAP
TaskPools.IO_POOL.submit(() ->
{
innerSctpDataSender.send(newBuf, 0, length);
Copy link
Contributor

Choose a reason for hiding this comment

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

Delegating to just any IO thread breaks outgoing SCTP packet order when the machine is under load.

Copy link
Member

Choose a reason for hiding this comment

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

The underlying transport (udp) doesn't guarantee order either

Copy link
Contributor

Choose a reason for hiding this comment

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

You're right. Thanks for pointing out that we're not dealing with user message here, but rather with the underlying protocol. I missed that.

@mstyura
Copy link
Contributor Author

mstyura commented Jun 18, 2020

@bbaldino ah, sorry, I've missed your comment. What I was trying to fix is to move usrsctp usage into a single thread to avoid multi threading bugs in usrsctp. This PR served as proof of concept, maybe later I'll make it acceptable to a master.

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

Successfully merging this pull request may close these issues.

4 participants