From bc37bcf5dce14af8f9337cff6c8aad5eef41a9f7 Mon Sep 17 00:00:00 2001 From: Patrik Ragnarsson Date: Sat, 6 Nov 2021 12:13:44 +0100 Subject: [PATCH] Rescue `Errno::EBADF` in `Client#close` (#2748) 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 0741107a..baa43f41 100644 --- a/lib/puma/client.rb +++ b/lib/puma/client.rb @@ -161,7 +161,7 @@ module Puma def close begin @io.close - rescue IOError + rescue IOError, Errno::EBADF Puma::Util.purge_interrupt_queue end end