Skip to content

Conversation

@ameboide
Copy link

@ameboide ameboide commented Mar 3, 2017

When a page is down, it stays in an infinite loop. Added a limit to break out of it (the full circuit by default).

@pirj
Copy link
Owner

pirj commented Mar 5, 2017

@ameboide What is the use case exactly? Exit from the script if the remote host or internet connection is down for a couple of minutes?
I don't mind including this change is you make it optional and off by default.

@JotaSe GitHub has recently added that reaction emojis, which are actually quite nice and indicate interest in a more accessible way than the flood of "+1" comments.

@ameboide
Copy link
Author

ameboide commented Mar 6, 2017

@pirj The use case is that the script should exit from the loop if the page is actually down or for some other reason is consistently responding with an error code. It doesn't make sense to keep switching proxies if the problem is in the other end.
I think it should always be on, with the maximum logical value by default (the circuit length), because if you try all the possible proxies and keep getting the same eror, it's clearly not a problem that can be solved by switching again. If you actually wanted to keep trying indefinitely, that's something that must be handled in the application, not here.

In my case, I had a sidekiq server that periodically executed a script that made a request to a certain page, and one day that page went down for maintenance and responded with a 403 (it's still down as of this moment). That meant the request remained in an endless loop, the script wouldn't finish, the sidekiq worker wouldn't be released, and all the available workers would be forever taken by different instances of the script, meaning it couldn't take other enqueued jobs and effectively breaking the application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants