Close the read pipe at the right moment#1351
Conversation
|
💚 CLA has been signed |
5d237df to
a3e6496
Compare
a3e6496 to
ec95e4d
Compare
|
jenkins please test |
|
Hi @estolfo, is there anything I have to fix on my side? |
|
Hi @matheussilvasantos thanks for following up. There are some test failures that I need to look at. They don't have to do with this code; it looks like one of the gems we test with dropped support for a version of Ruby we have in our test matrix. |
|
Hi @matheussilvasantos can you rebase against main now? The test failures have been resolved in the latest commit. Thanks! |
We can't close the read pipe inside the child thread because it won't always be executed, so in cases where some exception happens and prevent the child thread from being executed, there would be a file descriptor leak. We shall close the read side of the pipe whether we executed the child thread or not.
ec95e4d to
96bc259
Compare
|
Hi @estolfo. I've rebased it. |
|
jenkins please test |
🌐 Coverage report
|
|
Thanks @matheussilvasantos ! |
|
Thank you too, @estolfo. Do you intend to release it at RubyGems any time soon? |
|
@matheussilvasantos we just did a release within the last two weeks so I'm going to wait a little longer before doing another one, given that this is a bit of an edge case. |
|
Hi, again, Emily. Would you have an estimate of when you will release it? This caused issues in production once, and we want to avoid creating a dependency on GitHub by pointing our gem to the repo. Thanks! |
|
Hi @matheussilvasantos I was hoping to get this issue resolved and in the next release so was holding off. I'll give it a few more days and if it's not resolved by then, I'll do a release including this issue's fix. |
|
@matheussilvasantos v4.6.1 is released with this fix. Thanks again! |
We can't close the read pipe inside the child thread because it won't always be executed, so in cases where some exception happens and prevent the child thread from being executed, there would be a file descriptor leak. We shall close the read side of the pipe whether we executed the child thread or not.
|
@estolfo, thank you too! |
* elastic/main: (30 commits) docs: remove kibana endpoint (elastic#1381) Update status badge (elastic#1379) Create single status check that can be set as required (elastic#1378) Remove jenkins related precommit hooks (elastic#1380) Migrate Jenkinsfile 2 GH Actions Workflow (elastic#1366) Migrate update specs to updatecli (elastic#1375) v4.6.2 Fixing Faraday::RackBuilder::StackLocked (elastic#1371) Fix jruby docker images (elastic#1367) Update reference to sinatra main (elastic#1373) Update release:update_branch task to reference branch 4.x Add missing docs reference v4.6.1 Add security options to docker containers (elastic#1356) Make sure http status code is set when Faraday Middleware is used (elastic#1368) Use composite action for updatecli workflow (elastic#1365) Fix sha source in updatecli update-specs.yml (elastic#1363) Add update-specs updatecli workflow (elastic#1359) use jruby user to run docker containers (elastic#1355) Close the read pipe at the right moment (elastic#1351) ...
What does this pull request do?
Closes the read pipe whether the HTTP request thread was executed or not.
Why is it important?
If we only close the read pipe after the HTTP request inside the child thread, a file descriptor leak can happen.
Checklist
.rubocop.yml)Related issues