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

Allow parallel Accepts #43

Merged
merged 1 commit into from
Jan 15, 2024
Merged

Conversation

rlpeck
Copy link
Contributor

@rlpeck rlpeck commented Dec 19, 2023

It is not currently possible to safely run multiple goroutines that call Accept which means that we are limited in scale by how fast that Accept function returns. There are two issues that prevent using parallel Accepts

  1. Shutdown behavior. Currently the library depends on a single message sent over the error channel to exit out of the Accept function, subsequent calls will block indefinitely waiting for a message
  2. Re-use of the config attribute on listener. Currently the library only uses the config attribute on listener to store state about the request which means that a) 1 stream can change behavior for other streams b) There's a data race preventing parallel reads. We can fix this by creating a copy of the base configuration & attach that copy to the request

@ioppermann ioppermann merged commit 151a03c into datarhei:main Jan 15, 2024
3 of 4 checks passed
aler9 added a commit to bluenviron/mediamtx that referenced this pull request Jan 18, 2024
this allows to mitigate brute force attacks and is possible thanks to
datarhei/gosrt#43
aler9 added a commit to bluenviron/mediamtx that referenced this pull request Jan 18, 2024
this allows to mitigate brute force attacks and is possible thanks to
datarhei/gosrt#43
@rlpeck rlpeck deleted the bp/parallel-listens branch November 6, 2024 18:22
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.

2 participants