Is CoefficientsFactory thread safe?


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:

	at java.base/java.util.TreeMap.rotateRight(
	at java.base/java.util.TreeMap.fixAfterInsertion(
	at java.base/java.util.TreeMap.put(
	at org.orekit.propagation.semianalytical.dsst.utilities.CoefficientsFactory.computeVns(
	at org.orekit.propagation.semianalytical.dsst.forces.DSSTZonal.<init>(

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,


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.