Skip to content

NIAD-5467 - Clinical information missing from bundle - #1306

Merged
MartinWheelerMT merged 1 commit into
mainfrom
niad-5467-message-merge-issue
Aug 11, 2026
Merged

NIAD-5467 - Clinical information missing from bundle#1306
MartinWheelerMT merged 1 commit into
mainfrom
niad-5467-message-merge-issue

Conversation

@MartinWheelerMT

Copy link
Copy Markdown
Collaborator

What

  • Add 'synchronized' to COPC Message handler, due to race condition when attemping to e merge and uncompress large EHR Extract.
  • Update changelog.

Why

This has proven impossible to replicate locally, but we have identified an area where a race condition may occur when multiple threads may attempt to merge and uncompress a large EHR bundle at the same time, causing the bundle to be corrupted.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Internal change (non-breaking change with no effect on the functionality affecting end users)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • I have updated the Changelog with details of my change in the UNRELEASED section if this change will affect end users
  • A corresponding change has been made to the Mapping Documentation repository

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to prevent corruption of large EHR Extract bundles by adding synchronization around the “merge + uncompress + bundle” step in the COPC message flow, and documenting the fix in the changelog.

Changes:

  • Added a synchronized block around canMergeCompleteBundle / mergeAndBundleMessage in COPCMessageHandler.
  • Updated CHANGELOG.md with an Unreleased “Fixed” entry describing the race-condition mitigation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
gp2gp-translator/src/main/java/uk/nhs/adaptors/pss/translator/task/COPCMessageHandler.java Adds synchronization around merging/uncompressing the complete EHR Extract bundle.
CHANGELOG.md Documents the race-condition fix in the Unreleased section.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread CHANGELOG.md Outdated
@MartinWheelerMT
MartinWheelerMT force-pushed the niad-5467-message-merge-issue branch from bb27d90 to c72aa3c Compare August 11, 2026 08:49
Jonopono123
Jonopono123 previously approved these changes Aug 11, 2026
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

Images built and published to ECR using a Build Id of PR-1210-a00f99f

* Add 'syncronized' to COPC Message handler, due to race condition when attemping to e merge and uncompress large EHR Extract.
* Update changelog.
@github-actions

Copy link
Copy Markdown

Looks good. All 3 mutations in this change were killed.

class surviving killed
💯uk.nhs.adaptors.pss.translator.task.COPCMessageHandler 0 3

See https://pitest.org

@MartinWheelerMT
MartinWheelerMT enabled auto-merge (squash) August 11, 2026 09:27
@MartinWheelerMT
MartinWheelerMT merged commit ca5c708 into main Aug 11, 2026
41 of 43 checks passed
@MartinWheelerMT
MartinWheelerMT deleted the niad-5467-message-merge-issue branch August 11, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants