Repository navigation
GH Issue 1795: Make shared Formats number formats thread-safe - #1106
Merged
Merged
Conversation
This was referenced Nov 9, 2026
labkey-jeckels
approved these changes
Nov 10, 2026
labkey-adam
added a commit
to LabKey/targetedms
that referenced
this pull request
Nov 10, 2026
## Rationale This PR makes the shared number formats in `Formats` safe for concurrent use. They were single `DecimalFormat` instances used by many threads at once, and `DecimalFormat` isn't thread-safe, so concurrent formatting could render wrong digits. Fixes [GH Issue 1795](LabKey/internal-issues#1795). ## Related Pull Requests - LabKey/platform#8314 - LabKey/commonAssays#1106 - LabKey/ehrModules#1240 - LabKey/onprcEHRModules#1994 - LabKey/premiumModules#857 ## Changes - Precursor transition labels build the signed mass index directly instead of through a shared formatter
labkey-adam
added a commit
to LabKey/onprcEHRModules
that referenced
this pull request
Nov 10, 2026
## Rationale This PR makes the shared number formats in `Formats` safe for concurrent use. They were single `DecimalFormat` instances used by many threads at once, and `DecimalFormat` isn't thread-safe, so concurrent formatting could render wrong digits. Fixes [GH Issue 1795](LabKey/internal-issues#1795). ## Related Pull Requests - LabKey/platform#8314 - LabKey/commonAssays#1106 - LabKey/ehrModules#1240 - LabKey/premiumModules#857 - LabKey/targetedms#1304 ## Changes - The finance notification's shared dollar format is now thread-safe
labkey-adam
added a commit
to LabKey/ehrModules
that referenced
this pull request
Nov 10, 2026
## Rationale This PR makes the shared number formats in `Formats` safe for concurrent use. They were single `DecimalFormat` instances used by many threads at once, and `DecimalFormat` isn't thread-safe, so concurrent formatting could render wrong digits. Fixes [GH Issue 1795](LabKey/internal-issues#1795). ## Related Pull Requests - LabKey/platform#8314 - LabKey/commonAssays#1106 - LabKey/onprcEHRModules#1994 - LabKey/premiumModules#857 - LabKey/targetedms#1304 ## Changes - Clinical history formatting goes through the thread-safe wrapper instead of holding the shared format directly - Billing notification formats are thread-safe - Clinical history keeps full precision, omits missing units, and checks and reads fields with the same key
labkey-adam
added a commit
to LabKey/platform
that referenced
this pull request
Nov 10, 2026
## Rationale This PR makes the shared number formats in `Formats` safe for concurrent use. They were single `DecimalFormat` instances used by many threads at once, and `DecimalFormat` isn't thread-safe, so concurrent formatting could render wrong digits. Fixes [GH Issue 1795](LabKey/internal-issues#1795). ## Related Pull Requests - LabKey/commonAssays#1106 - LabKey/ehrModules#1240 - LabKey/onprcEHRModules#1994 - LabKey/premiumModules#857 - LabKey/targetedms#1304 ## Changes - Each shared format is now a synchronized `SafeDecimalFormat` wrapper, and the fields are final - Code that needs a `Format` object gets its own copy instead of the shared instance - Study sequence-number and module version formats use the wrapper too - Unit test for concurrent formatting - `Formats` fields change type and `chargeFilter` is removed, so external modules that assign these fields to a `DecimalFormat` or `Format`, or use `chargeFilter`, need updating
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.
Rationale
This PR makes the shared number formats in
Formatssafe for concurrent use. They were singleDecimalFormatinstances used by many threads at once, andDecimalFormatisn't thread-safe, so concurrent formatting could render wrong digits. Fixes GH Issue 1795.Related Pull Requests
Changes
Formatsand into MS2