Key the streamer map by output name so same-format outputs don't collide#153
Merged
maureeungaro merged 1 commit intoJun 13, 2026
Merged
Conversation
gstreamersMapPtr keyed the per-thread streamer map by the format-derived
plugin name ("gstreamer_<format>_plugin"), so two outputs of the same
format (e.g. two csv files with different filenames) mapped to the same
key: the second emplace was a no-op and the following .at()->
define_gstreamer() rebound the first instance to the second definition,
silently dropping one output.
Key the map by the unique per-output rootname instead (the plugin
library is still loaded by the format-derived name, and each load returns
a fresh GStreamer instance, so same-format outputs stay independent).
Duplicate output names are skipped with a warning. The map key is only
used as a log label at all iteration sites, so the rename is safe.
Validated by running the gstreamer CSV example with two csv outputs:
before, only the second output's files were written; after, both
output file sets are produced (Geant4 11.4.1 dev container).
Fixes gemc#106
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
gstreamersMapPtrkeyed the per-thread streamer map by the format-derived plugin name ("gstreamer_<format>_plugin"), so two outputs of the same format (e.g. twocsvfiles with different filenames) mapped to the same key: the secondemplacewas a no-op and the following.at()->define_gstreamer()rebound the first instance to the second definition — silently dropping one output.Key the map by the unique per-output
rootnameinstead. The plugin library is still loaded by the format-derived name, and eachLoadAndRegisterObjectFromLibrarycall returns a freshGStreamerinstance (only the dlopen handle is cached), so same-format outputs stay independent. Duplicate output names are skipped with a warning. The map key is only used as a log label at all iteration sites, so the rename is safe.Validation: ran the gstreamer CSV example with two
csvoutputs in the Geant4 11.4.1 dev container. Before: only the second output's 16 files were written (the first was lost). After: both output file sets (16 + 16) are produced.Fixes #106