Is CoefficientsFactory thread safe?

Hi,

I am performing several propagations using DSST, and I chose to make these propagation parallel using several threads (a new DSST propagator is created at each thread).

It looks like I have from time to time some issues at propagator initialization and it seems to come from the static variable CoefficientsFactory.VNS.

Thereafter is an example of the exception raised:

java.lang.NullPointerException
	at java.base/java.util.TreeMap.rotateRight(TreeMap.java:2240)
	at java.base/java.util.TreeMap.fixAfterInsertion(TreeMap.java:2272)
	at java.base/java.util.TreeMap.put(TreeMap.java:580)
	at org.orekit.propagation.semianalytical.dsst.utilities.CoefficientsFactory.computeVns(CoefficientsFactory.java:218)
	at org.orekit.propagation.semianalytical.dsst.forces.DSSTZonal.<init>(DSSTZonal.java:188)

After some researches (for example here), it seems that the structure of TreeMap used by the static variable VNS is not thread safe. That could explain the issue I am currently having?

What is your opinion?

Best regards,

Dorian

PS: It seems that I have this problem only at DSST propagator initialization, so I can perfecly live without correction by using making this initilization synchronized.

Hi @dorian

Do you have a test case reproducing the issue?

Anyway, it looks like a bug that shall be fixed. Could you open an issue?
Fix looks easy. I hope that it will not impact computation time.

Regards,
Bryan