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.rb - fix using both UNIX and TCP listeners #1987
Conversation
9ad8399
to
3823644
Compare
re forced push, I think |
Zero ports for SSL are not reported correctly and will be when 1987 is merged.
Closing in favor of #1989 |
that one got too complicated, coming back to this |
3823644
to
7cff494
Compare
I spent some more time looking at this, and decided to add tests for activated & inherited sockets. See the files changed in https://github.com/MSP-Greg/puma/tree/unix-and-tcp-listeners-t. Last four commits, except for 'local test rakefile, Action' ( I could separate it into another PR, but that may have merge issues if anything is changed in the first. Thoughts? Question - Inherited sockets ( Activated sockets ( systemd The code (in Lines 250 to 260 in 079b284
Aren't we removing fd's in |
@MSP-Greg re: those questions, please contact me via the email address on my profile |
Why discuss offline instead of GitHub? |
Patrik,
OFF TOPIC I think I can state that recently both Nate & I said something similar to "let's focus on a few existing, fixable issues and get a point release out", referring to this and the systemd issues. I think we both also started on things that morphed into larger, more involved changes, which went beyond what is needed for the point release. My post above was partially in frustration, as some of the work I did in my fork stabilized test_binder.rb, but I'd need to cherry pick those changes back into this PR, and take the additional test work (and its changes to the lib files) for another PR. Said another way, sometimes it's very frustrating to work on A (this PR), then work on B (my branch), and realize that B needs to be divided, one part moving back into A, and the balance saved for later. Been, there, done that, and it requires a lot of concentration, as A and B are stable, but dividing them may make A unstable until the 'division' is 'perfect'. Summing up, we're doing a 'bug fix' push. Next push is for refactoring, better test coverage, improvements, etc. So, I'm going to start working on that division. Nate & I have not communicated, so I'm not speaking for him in any way. Sorry for being off-topic, Greg |
1. Fix mult binds when unix is first, followed by ip bind. See issue puma#1986. 2. When localhost is used for ssl or tcp, output actual ip's bound to. 3. Fix issues with IPv6 bind logging (brackets). 4. Move ssl context initialization code from Binder#parse to new method, #ssl_ctx_init.
1. Add test combinations of multiple binds, localhost, port 0, etc. 2. Close sockets created by Binder#parse. 3. Refactor code. 4. Some redundant asserts. Could use cleanup to make more orthogonal.
6fe7b45
to
3d1f4c4
Compare
Updated. |
001152b
to
5b7093f
Compare
With the last commit, most tests using ssl binders run with JRuby, which is a change from the previous version, where very few ran. See: https://travis-ci.org/puma/puma/jobs/590983851#L411 |
5b7093f
to
436c4ba
Compare
Luckily, last Travis CI build allowed both JRuby jobs to run TestBinder before they locked up. All passed, including the 9.2.8.0 - https://travis-ci.org/puma/puma/jobs/591284029#L352-L365 |
Ok, now THIS one's too complicated. We need just tests + a simple hack fix for 4.2.1, not a full refactor (which is also what I attempted too). I know it's tempting because it's obviously going to help a lot of the bugs we're seeing around activation. The problem with a full refactor here is that the test coverage on binders is only ok and it's certainly nonexistent for inheriting/activating. |
The 'double path' bug has been fixed My current version of test/test_binder.rb is compatible with master, but I'd like to add more test coverage. So, I can either update this, or close this and create another PR. Thoughts? @nateberkopec - your call |
Closing in favor of #1989 |
See issue #1986
1st Commit - 'binder.rb - fix double binds and misc'
Fix mult binds when unix is first, followed by ip bind. See issue Error after binding to socket and port in one config #1986.
When localhost is used for ssl or tcp, output actual ip's bound to.
Fix issues with IPv6 bind logging (brackets).
Move ssl context initialization code from Binder#parse to new method, #ssl_ctx_init.
2nd Commit - 'test_binder.rb - add double bind tests, misc'
Add test combinations of multiple binds, localhost, port 0, etc.
Allow most tests using ssl binders to run on JRuby, including
MiniSSL::Context#no_tlsv*
tests, which all were previously only run on MRI Ruby.Close sockets created by Binder#parse.
Refactor code.
Some redundant asserts. Could use cleanup to make more orthogonal.