Skip to content

Conversation

@zsculac
Copy link
Collaborator

@zsculac zsculac commented Dec 12, 2025

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

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)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Note

Completes publish once minimum acknowledgements are reached (with duplicate-guard), fails when responses are exhausted, and adds stronger logging/error handling in publish finalization and Blazegraph updates; bumps version to 8.2.3.

  • Publish flow:
    • Completes operation as soon as minAckResponses are met, independent of total responses; guards with minAcksReached to prevent duplicate completion.
    • When all responses are in and minimum not met, marks as failed and emits PUBLISH_FAILED.
    • Improved info/warn logs and response summary reporting.
  • Publish finalization (src/commands/protocols/publish/publish-finalization-command.js):
    • Derives ual earlier; enhanced warnings when cached publish data read fails and when retry attempts are exhausted.
    • Refactors readWithRetries to compute datasetPath once and log path on failure.
  • Triple store (Blazegraph):
    • Wraps queryVoid in try/catch with detailed error logging (HTTP status and data snippet) and rethrows.
  • Version:
    • Bump version to 8.2.3.

Written by Cursor Bugbot for commit 43d08f2. This will update automatically on new commits. Configure here.

@zsculac zsculac merged commit cbc6a97 into v6/prerelease/testnet Dec 12, 2025
8 of 10 checks passed
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

null,
this.completedStatuses,
);
await this.repositoryModuleManager.updateMinAcksReached(operationId, true);
Copy link

Choose a reason for hiding this comment

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

Bug: Race condition in minimum replication check

The new logic introduces a TOCTOU (time-of-check-to-time-of-use) race condition. Multiple concurrent responses can all read record?.minAcksReached as false before any of them updates it to true. Since getOperationIdRecord and updateMinAcksReached are not executed atomically (they're outside the mutex), concurrent responses that exceed minAckResponses may all proceed to call markOperationAsCompleted, potentially completing the same operation multiple times. The previous logic avoided this by only acting when totalResponses === numberOfFoundNodes, ensuring exactly one caller would reach the decision point.

Fix in Cursor Fix in Web

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.

2 participants