From 5916a34f4bf55b162a2ffd59fdbc27415f8d7d5a Mon Sep 17 00:00:00 2001 From: Patrik Ragnarsson Date: Thu, 4 Nov 2021 00:15:07 +0100 Subject: [PATCH] Rescue `Errno::EBADF` in `Client#close` Spotted happening in CI: https://github.com/puma/puma/runs/4095295281?check_suite_focus=true 2021-11-03 16:34:54 +0000 Exception handling servers: #/Users/runner/work/puma/puma/lib/puma/client.rb:163:in `close': Bad file descriptor (Errno::EBADF) TestRackServer#test_large_post_body = from /Users/runner/work/puma/puma/lib/puma/client.rb:163:in `close' --- lib/puma/client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puma/client.rb b/lib/puma/client.rb index 0741107af7..baa43f41fe 100644 --- a/lib/puma/client.rb +++ b/lib/puma/client.rb @@ -161,7 +161,7 @@ def reset(fast_check=true) def close begin @io.close - rescue IOError + rescue IOError, Errno::EBADF Puma::Util.purge_interrupt_queue end end