We use the Mojo::UserAgent for our data scraper and we get lots of errors like this:
Use of uninitialized value $cb in method lookup at /usr/local/lib/perl5/Mojo/Reactor/Poll.pm line 141.
eval {...} called at /usr/local/lib/perl5/Mojo/Reactor/Poll.pm line 141
Mojo::Reactor::Poll::_try(Mojo::Reactor::EV=HASH(0x564e73e33fd8), "I/O watcher", undef, 0)
called at /usr/local/lib/perl5/Mojo/Reactor/EV.pm line 54
Looking at the code, the docs and similar bug reports this seems to be the result of EV::io emitting two or more events in succession with the earlier event removing the handler while the callback for a later event is still pending.
Mojo/Reactor/EV.pm will catch this situation, but only for write events (line 55). For read events the check for existance of the handler is missing (line 54).
Steps to reproduce the behavior
I've yet been unable to reproduce this error in a test case.
We use the Mojo::UserAgent for our data scraper and we get lots of errors like this:
Looking at the code, the docs and similar bug reports this seems to be the result of EV::io emitting two or more events in succession with the earlier event removing the handler while the callback for a later event is still pending.
Mojo/Reactor/EV.pm will catch this situation, but only for write events (line 55). For read events the check for existance of the handler is missing (line 54).
Steps to reproduce the behavior
I've yet been unable to reproduce this error in a test case.
Expected behavior
No errors.
Actual behavior
See above.