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

Fix NIOLoopBound issues #3081

Merged
merged 8 commits into from
Oct 6, 2023
Merged

Fix NIOLoopBound issues #3081

merged 8 commits into from
Oct 6, 2023

Conversation

0xTim
Copy link
Member

@0xTim 0xTim commented Oct 5, 2023

Fixes a number of issues where NIOLoopBound and NIOLoopBoundBox were used without ensuring we were on the correct event loop before accessing them. This could lead to precondition crashes

@0xTim 0xTim added the semver-patch Internal changes only label Oct 5, 2023
var eventLoopGroup: EventLoopGroup!

override func setUp() async throws {
eventLoopGroup = MultiThreadedEventLoopGroup(numberOfThreads: 8)
Copy link
Member

Choose a reason for hiding this comment

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

Why not just use the singleton?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll switch the this, this was my attempts to make it crash and ensure we definitely had more than one event loop

@0xTim
Copy link
Member Author

0xTim commented Oct 5, 2023

I've audited the other usages of NIOLoopBound and NIOLoopBoundBox and I can't see a way for the others to get off the event loop - there's always a check, or submit so I think we're good

@0xTim 0xTim marked this pull request as ready for review October 5, 2023 23:41
@codecov-commenter
Copy link

codecov-commenter commented Oct 5, 2023

Codecov Report

Merging #3081 (fba4d8c) into main (c17d9b9) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3081      +/-   ##
==========================================
+ Coverage   76.31%   76.34%   +0.02%     
==========================================
  Files         211      211              
  Lines        7853     7862       +9     
==========================================
+ Hits         5993     6002       +9     
  Misses       1860     1860              
Files Coverage Δ
Sources/Vapor/HTTP/BodyStream.swift 41.37% <100.00%> (+22.33%) ⬆️
Sources/Vapor/HTTP/Server/HTTPServerHandler.swift 93.87% <100.00%> (+0.12%) ⬆️

@0xTim 0xTim merged commit e38dfe4 into main Oct 6, 2023
16 checks passed
@0xTim 0xTim deleted the sendable-checking-errors branch October 6, 2023 01:43
@penny-for-vapor
Copy link

These changes are now available in 4.84.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch Internal changes only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash when unwrapping NIOLoopBound from responder without sufficient EL checks
3 participants