File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
java/software/amazon/jdbc/plugin/efm Expand file tree Collapse file tree 2 files changed +10
-1
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 ;
@@ -220,14 +223,17 @@ public void run() {
220
223
TimeUnit .MILLISECONDS .sleep (THREAD_SLEEP_WHEN_INACTIVE_MILLIS );
221
224
}
222
225
}
223
- } catch (final InterruptedException intEx ) {
226
+ } catch (final Exception ex ) {
224
227
// do nothing; exit thread
228
+ LOGGER .warning (() -> Messages .get ("MonitorImpl.exceptionDuringMonitoring" , new Object [] {ex .getMessage ()}));
225
229
} finally {
226
230
if (this .monitoringConn != null ) {
227
231
try {
228
232
this .monitoringConn .close ();
229
233
} catch (final SQLException ex ) {
230
234
// ignore
235
+ LOGGER .warning (
236
+ () -> Messages .get ("MonitorImpl.exceptionClosingMonitoringConn" , new Object [] {ex .getMessage ()}));
231
237
}
232
238
}
233
239
this .stopped = true ;
Original file line number Diff line number Diff line change @@ -188,6 +188,9 @@ 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.exceptionDuringMonitoring =An exception was thrown during monitoring: {0}
193
+ MonitorImpl.monitorIsStopped =Monitor has already stopped.
191
194
192
195
# Monitor Service Impl
193
196
MonitorServiceImpl.nullMonitorParam =Parameter 'monitor' should not be null.
You can’t perform that action at this time.
0 commit comments