-
Notifications
You must be signed in to change notification settings - Fork 74
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
conduit-lwt-unix: se accept_n on the server #387
Closed
Closed
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c5b3c46
conduit_lwt_server: use accept_n
mseri 763ab5f
conduit-lwt-unix: catch possible cancellations
mseri fe2ebe7
conduit-lwt-unix: all exceptions should be related to the cancellatio…
mseri 86d584a
conduit-lwt-unix: loop only outside cancellations
mseri 5793acf
conduit-lwt-unix.server: Allow to configure n
mseri cdeda3c
conduit-lwt-unix.server: minor cleanup
mseri e490592
conduit-lwt-unix.server: add a call to yield
mseri cf7c62f
Revert "conduit-lwt-unix.server: add a call to yield"
mseri a61511e
conduit_lwt_unix: use iter_s over the accepts, this should avoid race…
mseri d4ef50e
conduit_lwt_server: make linter happy
mseri 10e5b85
conduit_lwt_server: re-introduce call to pause in the accept loop
mseri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ val process_accept : | |
unit Lwt.t | ||
|
||
val init : | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I should probably document this, I was first waiting to see if you are interested at all and what the review says about the implementation |
||
?nconn:int -> | ||
?stop:unit Lwt.t -> | ||
(Lwt_unix.file_descr * Lwt_unix.sockaddr -> unit Lwt.t) -> | ||
Lwt_unix.file_descr -> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There may also be a race to update connected here since I am calling
iter_p
, right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite see the race you're referring to here -- where is the
iter_p
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I am not mistaken
iter_p
runs the iteration in parallel, andconnected ()
increments the active connection count without any protection (let connected () = incr active
). My fear was that multiple connections executed in parallel could try to increment the variable simultaneously (and I don't want to put a mutex there).