From cbef10876a6b127955c98677bc1d5998f0d3cebd Mon Sep 17 00:00:00 2001 From: mmichalek Date: Thu, 2 Aug 2018 10:53:41 -0400 Subject: [PATCH 1/3] 0003656: Routing log messages can be excessively long (3.9) --- .../org/jumpmind/symmetric/service/impl/RouterService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/RouterService.java b/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/RouterService.java index 644c1ec316..b9f9c55741 100644 --- a/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/RouterService.java +++ b/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/RouterService.java @@ -108,6 +108,8 @@ * @see IRouterService */ public class RouterService extends AbstractService implements IRouterService { + + final int MAX_LOGGING_LENGTH = 512; protected Map commonBatchesLastKnownState = new HashMap(); @@ -947,7 +949,9 @@ protected int selectDataAndRoute(ProcessInfo processInfo, ChannelRouterContext c + "totalDataRoutedCount={}, totalDataEventCount={}, startDataId={}, endDataId={}, dataReadCount={}, peekAheadFillCount={}, transactions={}, dataGaps={}", new Object[] { context.getChannel().getChannelId(), ((System.currentTimeMillis()-startTime) / 1000), totalDataCount, totalDataEventCount, context.getStartDataId(), context.getEndDataId(), context.getDataReadCount(), context.getPeekAheadFillCount(), - context.getTransactions().toString(), context.getDataGaps().toString() }); + StringUtils.abbreviate(context.getTransactions().toString(), MAX_LOGGING_LENGTH), + StringUtils.abbreviate(context.getDataGaps().toString(), MAX_LOGGING_LENGTH) + }); ts = System.currentTimeMillis(); } From 8aa263c4aae28934086afe80a0b4b91c2fcb1ec6 Mon Sep 17 00:00:00 2001 From: mmichalek Date: Fri, 3 Aug 2018 10:10:08 -0400 Subject: [PATCH 2/3] 0003658: Routing can fail due to ConcurrentModificationException while attempting to log "Routing for channel has been running..." --- .../org/jumpmind/symmetric/service/impl/RouterService.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/RouterService.java b/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/RouterService.java index b9f9c55741..b2e8a6a34d 100644 --- a/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/RouterService.java +++ b/symmetric-core/src/main/java/org/jumpmind/symmetric/service/impl/RouterService.java @@ -942,14 +942,13 @@ protected int selectDataAndRoute(ProcessInfo processInfo, ChannelRouterContext c } long routeTs = System.currentTimeMillis() - ts; - if (routeTs > LOG_PROCESS_SUMMARY_THRESHOLD) { + if (true || routeTs > LOG_PROCESS_SUMMARY_THRESHOLD) { engine.getClusterService().refreshLock(ClusterConstants.ROUTE); log.info( "Routing for channel '{}' has been processing for {} seconds. The following stats have been gathered: " - + "totalDataRoutedCount={}, totalDataEventCount={}, startDataId={}, endDataId={}, dataReadCount={}, peekAheadFillCount={}, transactions={}, dataGaps={}", + + "totalDataRoutedCount={}, totalDataEventCount={}, startDataId={}, endDataId={}, dataReadCount={}, peekAheadFillCount={}, dataGaps={}", new Object[] { context.getChannel().getChannelId(), ((System.currentTimeMillis()-startTime) / 1000), totalDataCount, totalDataEventCount, context.getStartDataId(), - context.getEndDataId(), context.getDataReadCount(), context.getPeekAheadFillCount(), - StringUtils.abbreviate(context.getTransactions().toString(), MAX_LOGGING_LENGTH), + context.getEndDataId(), context.getDataReadCount(), context.getPeekAheadFillCount(), StringUtils.abbreviate(context.getDataGaps().toString(), MAX_LOGGING_LENGTH) }); ts = System.currentTimeMillis(); From 617c0591b5a9bcd1c32a8743c1eff19c4e7d1ae8 Mon Sep 17 00:00:00 2001 From: elong Date: Fri, 3 Aug 2018 12:44:51 -0400 Subject: [PATCH 3/3] allow caller to specify both app home and wrapper config file --- .../main/java/org/jumpmind/symmetric/wrapper/Wrapper.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/symmetric-wrapper/src/main/java/org/jumpmind/symmetric/wrapper/Wrapper.java b/symmetric-wrapper/src/main/java/org/jumpmind/symmetric/wrapper/Wrapper.java index a2bd2e41ad..ccb4acce16 100644 --- a/symmetric-wrapper/src/main/java/org/jumpmind/symmetric/wrapper/Wrapper.java +++ b/symmetric-wrapper/src/main/java/org/jumpmind/symmetric/wrapper/Wrapper.java @@ -37,9 +37,12 @@ public static void main(String[] args) throws Exception { String configFile = null; String jarFile = Wrapper.class.getProtectionDomain().getCodeSource().getLocation().getFile(); - if (args.length > 1) { + if (args.length == 2) { configFile = args[1]; appDir = getParentDir(configFile); + } else if (args.length == 3) { + configFile = args[1]; + appDir = args[2]; } else { appDir = getParentDir(jarFile); configFile = findConfigFile(appDir + File.separator + "conf");