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

Binder refactor #1989

Closed
wants to merge 4 commits into from
Closed

Binder refactor #1989

wants to merge 4 commits into from

Conversation

nateberkopec
Copy link
Member

@nateberkopec nateberkopec commented Sep 25, 2019

  • Bindings inheritance model? SSLBinder, UnixBinder, etc

Doing an inheritance model could probably help me take a lot of the complexity out of Binder#parse and the various inherit_ and add_ listener methods...

@nateberkopec nateberkopec changed the title Msp greg unix and tcp listeners Fix multiple binds logging + refactor Sep 25, 2019
when UNIXServer
["unix", i.local_address]
when Puma::MiniSSL::Server
["ssl", i.to_io.local_address]
Copy link
Member Author

Choose a reason for hiding this comment

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

This has the advantage of logging port 0 binds with SSL correctly too.

@nateberkopec
Copy link
Member Author

@MSP-Greg thoughts?

@nateberkopec
Copy link
Member Author

Oh, on windows, UNIXServer isn't even defined?

@nateberkopec
Copy link
Member Author

I need to think about how this affects inherited listeners, and whether or not I should be iterating through @listeners or @ios

@nateberkopec
Copy link
Member Author

I don't think it matters whether or not I'm iterating through listeners or ios. Unfortunately, those are supposed to be the same data AFAICT. I think we should probably just have one collection in binders (merging ios and listeners), a collection of a new value object (call it Binding?). That would make a lot of stuff a lot nicer.

I don't really want to do that refactoring right now but I think I have to in order to log inherited sockets once rather than twice (which this will now do).

@nateberkopec
Copy link
Member Author

This is ending up a lot more intense than something that can just fix that bug and go into a patch release. Once I finish this I'll walk it back to something that can, maybe even just Greg's original fix + test.

@nateberkopec nateberkopec changed the title Fix multiple binds logging + refactor Binder refactor Sep 26, 2019
@nateberkopec nateberkopec added feature and removed bug labels Sep 26, 2019
@nateberkopec nateberkopec self-assigned this Sep 26, 2019
@nateberkopec nateberkopec force-pushed the MSP-Greg-unix-and-tcp-listeners branch 4 times, most recently from 6d102f5 to c35cccf Compare October 7, 2019 14:27
@nateberkopec nateberkopec force-pushed the MSP-Greg-unix-and-tcp-listeners branch from c35cccf to 60d7fe7 Compare October 7, 2019 14:29
@nateberkopec
Copy link
Member Author

I think it's time for me to stop the spike for now and pull back a few of these things into master.

@MSP-Greg
Copy link
Member

@nateberkopec

As to the emoji I added, it reminded me of how "I want to fix a few issues" often turns into a lot more. At least that's been the case with me...

I don't think it matters whether or not I'm iterating through listeners or ios. Unfortunately, those are supposed to be the same data AFAICT.

I think the current code only loads listeners in the parse code. ios is loaded in the add/inherit code. So, control url's aren't in listeners, and any sockets created via re-entrant calls in the add/inherit code are also not. I think...

composerinteralia added a commit to composerinteralia/puma that referenced this pull request Oct 20, 2019
This commit extracts the `MiniSSL::Context` creation into its own
`MiniSSL::ContextBuilder` class along the same lines as in [puma#1989].

This will allow us to reuse this code for adding SSL support to the
control app (issue [puma#2015]). Since we will need the `MiniSSL` require
and check in both places, I moved that into the `ContextBuilder` class
as well.

[puma#1989]: puma#1989
[puma#2015]: puma#2015
nateberkopec pushed a commit that referenced this pull request Oct 21, 2019
* Extract class for building SSL context

This commit extracts the `MiniSSL::Context` creation into its own
`MiniSSL::ContextBuilder` class along the same lines as in [#1989].

This will allow us to reuse this code for adding SSL support to the
control app (issue [#2015]). Since we will need the `MiniSSL` require
and check in both places, I moved that into the `ContextBuilder` class
as well.

[#1989]: #1989
[#2015]: #2015

* Add SSL support for the control app

This starts to address [#2015]. I think we will need to add SSL support
to the control cli as well.

[#2015]: #2015
@nateberkopec
Copy link
Member Author

Closing as unmergeable, but I do want to revisit the ideas in here very soon.

@nateberkopec nateberkopec deleted the MSP-Greg-unix-and-tcp-listeners branch March 14, 2020 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants