ProcessingException was changed to IllegalStateException
This patch fix the exception handling for connection problem, instead of ProcessingException it now expect IllegalStateException. The rest of the functionality remains the same. Fixes #26 Signed-off-by: Amnon Heiman <amnon@scylladb.com> Message-Id: <1458602355-23601-1-git-send-email-amnon@scylladb.com>
This commit is contained in:
parent
d7e3dae323
commit
8f90d413a1
Notes:
Pekka Enberg
2016-03-22 08:56:01 +02:00
backport: 1.0
@ -132,14 +132,10 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean {
|
||||
}
|
||||
}
|
||||
missed_response = 0;
|
||||
} catch (ProcessingException e) {
|
||||
if (Throwables.getRootCause(e) instanceof ConnectException) {
|
||||
if (missed_response++ > MAX_RETRY) {
|
||||
System.err.println("API is not available, JMX is shuting down");
|
||||
System.exit(-1);
|
||||
}
|
||||
} else {
|
||||
// ignoring exceptions, will retry on the next interval
|
||||
} catch (IllegalStateException e) {
|
||||
if (missed_response++ > MAX_RETRY) {
|
||||
System.err.println("API is not available, JMX is shuting down");
|
||||
System.exit(-1);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// ignoring exceptions, will retry on the next interval
|
||||
|
@ -138,7 +138,7 @@ public final class MessagingService implements MessagingServiceMBean {
|
||||
}
|
||||
connection_failure = 0;
|
||||
report_error = 1;
|
||||
} catch (ProcessingException e) {
|
||||
} catch (IllegalStateException e) {
|
||||
// Connection problem, No need to do anything, just retry.
|
||||
} catch (Exception e) {
|
||||
connection_failure++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user