From 73338edaea1b400b2f787b77c4b86bd7c7be2d55 Mon Sep 17 00:00:00 2001 From: v1k1nghawk Date: Wed, 30 Nov 2022 13:11:43 +0100 Subject: [PATCH] disabled output with MongoInterruptedException's msg and its stacktrace during worker thread's stop in BenchmarkCommand --- .../socialite/cli/BenchmarkCommand.java | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/mongodb/socialite/cli/BenchmarkCommand.java b/src/main/java/com/mongodb/socialite/cli/BenchmarkCommand.java index 8d403dc..78d276f 100644 --- a/src/main/java/com/mongodb/socialite/cli/BenchmarkCommand.java +++ b/src/main/java/com/mongodb/socialite/cli/BenchmarkCommand.java @@ -210,17 +210,24 @@ protected void run(Bootstrap configBootstrap, reporter.start(1,TimeUnit.SECONDS); final List> futures = new ArrayList>(namespace.getInt("concurrency")); - for( int i = 0; i < concurrency; i++ ){ + for( int i = 0; i < concurrency; i++ ) { final Runnable worker = new Runnable() { public void run() { - try{ - model.next(userResource, timers); - } - catch(Exception e){ - logger.error(e.toString()); - e.printStackTrace(); - logger.debug("", e); - } + try { + model.next(userResource, timers); + } + catch(com.mongodb.MongoInterruptedException mie) { + if(logger.isDebugEnabled()) { + logger.debug("", mie); + } + } + catch(Exception e) { + logger.error(e.toString()); + e.printStackTrace(); + if(logger.isDebugEnabled()) { + logger.debug("", e); + } + } } };