-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Give up processing and throw ConfigException when "Auth fail" appears at the first time #33
Conversation
… at the first time
@@ -264,6 +264,12 @@ else if (files.isFile()) { | |||
@Override | |||
public boolean isRetryableException(Exception exception) | |||
{ | |||
if (exception.getCause() != null && exception.getCause().getCause() != null) { | |||
Throwable cause = exception.getCause().getCause(); | |||
if (cause.getMessage().contains("Auth fail")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: this could have NPE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be nice to have a small test to make sure no retry for 'Auth fail' :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a test to make sure ConfigException
is thrown.
To check no retry might be a bit difficult.
@@ -266,7 +266,7 @@ public boolean isRetryableException(Exception exception) | |||
{ | |||
if (exception.getCause() != null && exception.getCause().getCause() != null) { | |||
Throwable cause = exception.getCause().getCause(); | |||
if (cause.getMessage().contains("Auth fail")) { | |||
if (!cause.getMessage().isEmpty() && cause.getMessage().contains("Auth fail")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for confusion 🙇
What I mean is some exceptions won't have message, for example: java.util.concurrent.TimeoutException
. So this line still could raise NPE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 (sorry for the back and forth)
Thanks! |
Follow up for #29
I had improved retry logic while getting file list before #29
Plugin will throw ConfigException when "Auth fail" happens after several retries.
I thought this plugin was a bit unstable, so it's better to retry even if exception is "Auth fail".
However, I found that some external services detect such retry as a invalid access from bot.
They add our source IP to IP black list.
I think it's time to give up to retry "Auth fail" when it first appears.
Stacktrace