emgiezet / errbit-php

PHP Errbit/AirBrake Client - Only One Working and Tested
45 stars 12 forks source link

Socket Closed Before Writing Finishes #25

Closed mickadoo closed 1 year ago

mickadoo commented 4 years ago

I'm not sure if this is just something that affects me because of configuration, but it seems to be a big problem in getting reporting to work.

A lot of the time the error reports are not hitting my Errbit instance. After some debugging I found that it does work when I'm stepping through the code and eventually narrowed it down to whether or not there's a pause after this line:

           // src/Errbit/Writer/SocketWriter.php

            } else {
                fwrite($socket, $payLoad);
            }

            // A sleep() or just pausing the debugger here makes all the difference

            fclose($socket);

Any pause at all here means that the error is logged to my local instance. Leaving the code as it is means that nothing gets logged. Has anyone else run into this problem?

emgiezet commented 1 year ago

@mickadoo Thanks for improvement! So sorry for slow poke reaction here.