You did not specify what hit_mdm () is, but presumably this is something that calls get_response based on the settings of Net :: HTTP earlier.
There are many places on the Internet where you can find evidence that Net :: HTTP is probably thread safe, but nothing final.
I have done a lot of stress testing with Net :: HTTP and threads, and my experience is that EOFErrors are common problems with multiple HTTP connections. Whether this is due to a server or client, or to a connection or Net :: HTTP library, it will be very difficult to debug, especially using streaming code that performs TCP communication, which also has threads in a sense.
You can use wirehark to find out where the EOFError comes from, or you could save a lot of headache and just save the EOFError on sysread (your backtrace can tell you where to put the rescue so that it only triggers a Net :: HTTP call, if that's where an EOFError is generated).
But without further information, we cannot tell you why an EOFError occurs exactly.
source share