-
Notifications
You must be signed in to change notification settings - Fork 656
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix EventLoopFuture.and's serious threading issues [alternative] #176
fix EventLoopFuture.and's serious threading issues [alternative] #176
Conversation
Motivation: EventLoopFuture.and had serious threading issues if the EventLoops weren't the same. Modifications: Fixed the threading issues and tested them properly. Result: Hopefully `and` and `andAll` now don't crash if you use them across EventLoops.
18fafdb
to
ab05365
Compare
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.
Ok, I think I like this a lot better than its competitor. We should take this patch, and then add a work item to go back and revisit the APIs here.
thanks for pushing me to do something @Lukasa , thought the alternatives would be too risky (in perf/bugs) but wasn't quite right ;) |
_whenComplete { () -> CallbackList in | ||
switch self.value! { | ||
case .failure(let error): | ||
return promise._setValue(value: .failure(error)) | ||
case .success(let t): | ||
andlock.lock() |
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.
less locks FTW!
Motivation: EventLoopFuture.and had serious threading issues if the EventLoops weren't the same. Modifications: Fixed the threading issues and tested them properly. Result: Hopefully `and` and `andAll` now don't crash if you use them across EventLoops.
Motivation: The code-of-conduct email address is out-of-date. Modifications: Update code-of-conduct email address to swift-server-conduct@group.apple.com Result: - Code of conduct email address is up-to-date.
Motivation Currently we don't confirm that the decompression has completed successfully. This means that we can incorrectly spin forever attempting to decompress past the end of a message, and that we can fail to notice that a message is truncated. Neither of these is good. Modifications Propagate the message zlib gives us as to whether or not decompression is done, and keep track of it. Add some tests written by @vojtarylko to validate the behaviour. Result Correctly police the bounds of the messages. Resolves apple#175 and apple#176.
alternative to #175
Motivation:
EventLoopFuture.and had serious threading issues if the EventLoops
weren't the same.
Modifications:
Fixed the threading issues and tested them properly.
Result:
Hopefully
and
andandAll
now don't crash if you use them acrossEventLoops.