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>
(cherry picked from commit 8f90d413a1)
This commit is contained in:
Amnon Heiman 2016-03-22 01:19:15 +02:00 committed by Pekka Enberg
parent 9718d87e80
commit 080042318e
2 changed files with 5 additions and 9 deletions

View File

@ -132,15 +132,11 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean {
} }
} }
missed_response = 0; missed_response = 0;
} catch (ProcessingException e) { } catch (IllegalStateException e) {
if (Throwables.getRootCause(e) instanceof ConnectException) {
if (missed_response++ > MAX_RETRY) { if (missed_response++ > MAX_RETRY) {
System.err.println("API is not available, JMX is shuting down"); System.err.println("API is not available, JMX is shuting down");
System.exit(-1); System.exit(-1);
} }
} else {
// ignoring exceptions, will retry on the next interval
}
} catch (Exception e) { } catch (Exception e) {
// ignoring exceptions, will retry on the next interval // ignoring exceptions, will retry on the next interval
} }

View File

@ -138,7 +138,7 @@ public final class MessagingService implements MessagingServiceMBean {
} }
connection_failure = 0; connection_failure = 0;
report_error = 1; report_error = 1;
} catch (ProcessingException e) { } catch (IllegalStateException e) {
// Connection problem, No need to do anything, just retry. // Connection problem, No need to do anything, just retry.
} catch (Exception e) { } catch (Exception e) {
connection_failure++; connection_failure++;