Skip to content

100% cpu usage when connect fails #192

bduggan opened this Issue Aug 2, 2011 · 2 comments

2 participants

bduggan commented Aug 2, 2011

When I run this :

use Mojo::UserAgent;
my $ua = Mojo::UserAgent->new();
$ua->get( 'http://localhost:9999' => sub { 1; } );

..and there is no server listening on port 9999, CPU
usage goes to 100%.

I realize that adding "Mojo::IOLoop->stop" would prevent this, but I'd like to auto-retry within the event loop after 5 seconds instead of stopping, like this :

That program works, but it uses 100% cpu when there is no connection.


kraih commented Aug 2, 2011

Thanks, fixed. 41c1ef8

@kraih kraih closed this Aug 2, 2011
bduggan commented Aug 2, 2011

That fixed it. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.