[GENIUS-237] Excessive toString() in EntityOwnershipUtils Created: 12/Nov/18  Updated: 22/Nov/18  Resolved: 22/Nov/18

Status: Resolved
Project: genius
Component/s: None
Affects Version/s: Oxygen-SR3
Fix Version/s: Oxygen-SR4, Fluorine-SR2, Neon

Type: Bug Priority: Medium
Reporter: Michael Vorburger Assignee: Michael Vorburger
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
is blocked by INFRAUTILS-60 JobCoordinator key Object instead String Resolved

 Description   

I'm looking at a Java Flight Recording obtained from (internal) scale lab testing, and see extensive "TLAB Allocations" due to what appears to be a clear mistake causing excessive toString() usage in EntityOwnershipUtils.runOnlyInOwnerNode():

char[] java.util.Arrays.copyOf(char[], int)	939
void java.lang.AbstractStringBuilder.ensureCapacityInternal(int)	939
AbstractStringBuilder java.lang.AbstractStringBuilder.append(String)	880
StringBuilder java.lang.StringBuilder.append(String)	880
String org.opendaylight.mdsal.eos.common.api.GenericEntity.toString()	340
void org.opendaylight.genius.utils.clustering.EntityOwnershipUtils.runOnlyInOwnerNode(String, String, JobCoordinator, String, Runnable)	340
void org.opendaylight.genius.interfacemanager.listeners.InterfaceTopologyStateListener.runOnlyInOwnerNode(String, Runnable)	340
void org.opendaylight.genius.interfacemanager.listeners.InterfaceTopologyStateListener.update(InstanceIdentifier, OvsdbBridgeAugmentation, OvsdbBridgeAugmentation)	340
void org.opendaylight.genius.interfacemanager.listeners.InterfaceTopologyStateListener.update(InstanceIdentifier, DataObject, DataObject)	340
void org.opendaylight.genius.datastoreutils.AsyncClusteredDataTreeChangeListenerBase$DataTreeChangeHandler.run()	340
void java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker)	340
void java.util.concurrent.ThreadPoolExecutor$Worker.run()	340
void java.lang.Thread.run()	340


 Comments   
Comment by Faseela K [ 13/Nov/18 ]

vorburger : Do you want me to assign an owner to this bug, or you are going to fix by yourself?

Comment by Michael Vorburger [ 13/Nov/18 ]

Looking more closely at this, we find that EntityOwnershipUtils (by tpantelis) does, has to do:

Entity entity = new Entity(entityType, entityName);
coordinator.enqueueJob(entity.toString(), () -> { ...

We could improve this if we did INFRAUTILS-60 ...

Comment by Michael Vorburger [ 16/Nov/18 ]

INFRAUTILS-60 has degenerated into (another) infrautils bashing exercice, and resolving that does not align with the sort of timeframe I would like to wrap up this issue in (ASAP). I've therefore proposed a simple local fix for this in c/77901 instead.

Generated at Wed Feb 07 20:00:15 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.