diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/statistics/ERXStatisticsStore.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/statistics/ERXStatisticsStore.java index c49fd44ad3b..f4849485b50 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/statistics/ERXStatisticsStore.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/statistics/ERXStatisticsStore.java @@ -133,17 +133,27 @@ protected void endTimer(WOContext aContext, String aString) { } Thread currentThread = Thread.currentThread(); - Map traces = _fatalTraces.remove(currentThread); - Map names = _fatalTracesNames.remove(currentThread); + + // get the most severe trace for the current thread + Map traces = _fatalTraces.get(currentThread); + Map names = _fatalTracesNames.get(currentThread); if (traces == null) { - traces = _errorTraces.remove(currentThread); - names = _errorTracesNames.remove(currentThread); + traces = _errorTraces.get(currentThread); + names = _errorTracesNames.get(currentThread); } if (traces == null) { - traces = _warnTraces.remove(currentThread); - names = _warnTracesNames.remove(currentThread); + traces = _warnTraces.get(currentThread); + names = _warnTracesNames.get(currentThread); } - + + // remove the current thread for _all_ traces + _fatalTraces.remove(currentThread); + _fatalTracesNames.remove(currentThread); + _errorTraces.remove(currentThread); + _errorTracesNames.remove(currentThread); + _warnTraces.remove(currentThread); + _warnTracesNames.remove(currentThread); + synchronized (_requestThreads) { _requestThreads.remove(Thread.currentThread()); }