-
Notifications
You must be signed in to change notification settings - Fork 653
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
Bootstraps should be thread-safe/Sendable #2846
Comments
It’s an accident. Their current non-Sendability is a reflection of their actual implementation, but we shouldn’t keep it that way. |
Okay, sounds good. I'll retitle this issue then. |
Hmm. What's a better approach, make the API backwards-compatible and make the existing bootstraps I think |
The existing bootstraps absolutely should not be made We should be a bit clear here: the bootstraps currently aren't Sendable. This is not a statement about them missing the There's also the matter of the fact that the bootstraps lack of Finally, the bootstraps would be overdue a replacement anyway, as they're really struggling to handle having |
To add to this. Any new implementation of bootstraps needs to be closely tied to our new async interop APIs in my opinion. While we need to leave room for just pure NIO based bootstraps. The async interop ones impose additional requirements on the design of bootstraps. Besides becoming When I last thought about this. I was thinking something along this API for new bootstraps:
The above is just meant for illustrative purposes and there a lot of open questions with this. |
This is what I thought — sure, we could attempt to patch up current class-based Bootstraps with NIOLocks or other form of mutexes, but I wasn't sure it's worth it. I could try and work on that, this is manageable at least in terms of API changes (preferably none), and at least we know where some problems might crop up and test for them. The shift away from builder pattern to structs is more exciting, but I hear what you're saying @FranzBusch, I won't have enough experience yet to drive the conversation on the right API design and implement them. |
In the very short term I'm not really sure how valuable the move using mutexes would be. The bootstraps not being Sendable is not something we've received loads of feedback about, but @weissi may have heard more. |
NIO's bootstraps have traditionally not been thread-safe (and therefore aren't
Sendable
either). I'm not so sure anymore if that was historically an accident or deliberate :).FWIW, Netty's are thread-safe: netty/netty#14063
The text was updated successfully, but these errors were encountered: