File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
java/software/amazon/jdbc/plugin/efm Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,9 @@ public MonitorImpl(
94
94
95
95
@ Override
96
96
public void startMonitoring (final MonitorConnectionContext context ) {
97
+ if (this .stopped ) {
98
+ LOGGER .warning (() -> Messages .get ("MonitorImpl.monitorIsStopped" ));
99
+ }
97
100
final long currentTimeNano = this .getCurrentTimeNano ();
98
101
context .setStartMonitorTimeNano (currentTimeNano );
99
102
this .contextLastUsedTimestampNano = currentTimeNano ;
@@ -222,12 +225,24 @@ public void run() {
222
225
}
223
226
} catch (final InterruptedException intEx ) {
224
227
// do nothing; exit thread
228
+ LOGGER .warning (
229
+ () -> Messages .get (
230
+ "MonitorImpl.interruptedExceptionDuringMonitoring" ,
231
+ new Object [] {this .hostSpec .getHost (), intEx .getMessage ()}));
232
+ } catch (final Exception ex ) {
233
+ // do nothing; exit thread
234
+ LOGGER .warning (
235
+ () -> Messages .get (
236
+ "MonitorImpl.exceptionDuringMonitoring" ,
237
+ new Object [] {this .hostSpec .getHost (), ex .getMessage ()}));
225
238
} finally {
226
239
if (this .monitoringConn != null ) {
227
240
try {
228
241
this .monitoringConn .close ();
229
242
} catch (final SQLException ex ) {
230
243
// ignore
244
+ LOGGER .warning (
245
+ () -> Messages .get ("MonitorImpl.exceptionClosingMonitoringConn" , new Object [] {ex .getMessage ()}));
231
246
}
232
247
}
233
248
this .stopped = true ;
Original file line number Diff line number Diff line change @@ -188,6 +188,10 @@ MonitorThreadContainer.emptyNodeKeys=Provided node keys are empty.
188
188
189
189
# Monitor Impl
190
190
MonitorImpl.contextNullWarning =Parameter 'context' should not be null.
191
+ MonitorImpl.exceptionClosingMonitoringConn =An exception was thrown when trying to close the monitoring connection: {0}
192
+ MonitorImpl.interruptedExceptionDuringMonitoring =Monitoring thread for node {0} was interrupted: {1}
193
+ MonitorImpl.exceptionDuringMonitoring =Unhandled exception in monitoring thread for node {0}: {1}
194
+ MonitorImpl.monitorIsStopped =Monitor has already stopped.
191
195
192
196
# Monitor Service Impl
193
197
MonitorServiceImpl.nullMonitorParam =Parameter 'monitor' should not be null.
You can’t perform that action at this time.
0 commit comments