Skip to content

Fix UCTE naming strategy state sharing across concurrent exports - #4078

Open
jeandemanged wants to merge 4 commits into
mainfrom
fix-ucte-exporter-naming-strategy
Open

Fix UCTE naming strategy state sharing across concurrent exports#4078
jeandemanged wants to merge 4 commits into
mainfrom
fix-ucte-exporter-naming-strategy

Conversation

@jeandemanged

@jeandemanged jeandemanged commented Aug 27, 2026

Copy link
Copy Markdown
Member

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • A PR or issue has been opened in all impacted repositories (if any)

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?

  • No

Other information:

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
jeandemanged force-pushed the fix-ucte-exporter-naming-strategy branch from 975ad02 to 4a0cba9 Compare August 27, 2026 19:00
@jeandemanged jeandemanged removed the Breaking Change API is broken label Aug 27, 2026
@olperr1 olperr1 added the bug label Aug 31, 2026
@olperr1

olperr1 commented Aug 31, 2026

Copy link
Copy Markdown
Member

Sounds like a bug to me too.

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Approved

Development

Successfully merging this pull request may close these issues.

2 participants