shoothzj commented on code in PR #4300:
URL: https://github.com/apache/bookkeeper/pull/4300#discussion_r1571926504
##########
stats/bookkeeper-stats-api/src/main/java/org/apache/bookkeeper/stats/ThreadRegistry.java:
##########
@@ -40,14 +51,16 @@ public static void register(String threadPool, int
threadPoolThread) {
*/
public static void register(String threadPool, int threadPoolThread, long
threadId) {
ThreadPoolThread tpt = new ThreadPoolThread(threadPool,
threadPoolThread, threadId);
- threadPoolMap.put(threadId, tpt);
+ ThreadPoolThread previous = threadPoolMap.put(threadId, tpt);
+ assert previous == null : "Thread " + threadId + " was already
registered in thread pool " + previous.threadPool + " as thread " +
previous.ordinal;
Review Comment:
@eolivelli assert is not encouraged by ivankelly #995
##########
stats/bookkeeper-stats-api/src/main/java/org/apache/bookkeeper/stats/ThreadRegistry.java:
##########
@@ -40,14 +51,16 @@ public static void register(String threadPool, int
threadPoolThread) {
*/
public static void register(String threadPool, int threadPoolThread, long
threadId) {
ThreadPoolThread tpt = new ThreadPoolThread(threadPool,
threadPoolThread, threadId);
- threadPoolMap.put(threadId, tpt);
+ ThreadPoolThread previous = threadPoolMap.put(threadId, tpt);
+ assert previous == null : "Thread " + threadId + " was already
registered in thread pool " + previous.threadPool + " as thread " +
previous.ordinal;
Review Comment:
@eolivelli @michaeljmarshall assert is not encouraged by ivankelly #995
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]