Fix UCTE naming strategy state sharing across concurrent exports - #4078
Open
jeandemanged wants to merge 4 commits into
Open
Fix UCTE naming strategy state sharing across concurrent exports#4078jeandemanged wants to merge 4 commits into
jeandemanged wants to merge 4 commits into
Conversation
Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
…rts" This reverts commit 66124f1. Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
Signed-off-by: Damien Jeandemange <damien.jeandemange@artelys.com>
jeandemanged
force-pushed
the
fix-ucte-exporter-naming-strategy
branch
from
August 27, 2026 19:00
975ad02 to
4a0cba9
Compare
olperr1
approved these changes
Aug 31, 2026
Member
|
Sounds like a bug to me too. |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
No
What kind of change does this PR introduce?
Sounds like a significant bug to me, if this was deliberate I am open to hear about it
What is the current behavior?
The NamingStrategy used per export is a shared singleton, not a fresh instance. Every call to UcteExporter.export(), from any thread, gets back the identical DefaultNamingStrategy/CounterNamingStrategy instance for the process lifetime. That singleton carries mutable, non-thread-safe, never-cleared state (ucteNodeIds and ucteElementIds maps, and the voltageLevelCounter for the CounterNamingStrategy).
Two concurrent UCTE exports, or two sequential exports of networks reusing the same element/bus ids, could corrupt or leak each other's generated UCTE codes.
What is the new behavior (if this is a feature change)?
Fixed UCTE exporter's NamingStrategy to be thread-safe for concurrent exports by creating a new fresh NamingStrategy implementation instance per-export.
Does this PR introduce a breaking change or deprecate an API?
Other information: