Skip to content

Avoid holding ProcedureManager lock while waiting for table tasks - #18673

Merged
jt2594838 merged 1 commit into
apache:masterfrom
Caideyipi:fix/procedure-manager-wait-outside-lock
Sep 21, 2026
Merged

jt2594838 merged 1 commit into
apache:masterfrom
Caideyipi:fix/procedure-manager-wait-outside-lock

Conversation

@Caideyipi

Copy link
Copy Markdown
Collaborator

Description

Problem

ProcedureManager.executeWithoutDuplicate and deleteDevices waited for a table procedure while still holding the ProcedureManager monitor. If a duplicate request waited on a slow procedure, unrelated table operations could not enter their duplicate-check and submission sections.

Changes

  • Keep duplicate detection and procedure submission inside the synchronized section.
  • Capture the procedure being waited on and release the monitor before waiting for completion.
  • Apply the same fix to deleteDevices.
  • Add concurrent regression tests for duplicate create-table and delete-devices requests. Each test verifies that an unrelated table procedure can still be submitted while the duplicate request is waiting.

Verification

  • mvn spotless:apply -pl iotdb-core/confignode
  • mvn test -pl iotdb-core/confignode "-Dtest=ProcedureManagerTest,ProcedureManagerTableTaskTest"
    • Tests run: 8, Failures: 0, Errors: 0, Skipped: 0

This PR has:

  • been self-reviewed.
    • concurrent write
  • added unit tests to cover the new concurrent code paths.

Key changed/added classes
  • ProcedureManager
  • ProcedureManagerTableTaskTest

@jt2594838
jt2594838 merged commit 76005c9 into apache:master Sep 21, 2026
42 of 43 checks passed
@jt2594838
jt2594838 deleted the fix/procedure-manager-wait-outside-lock branch September 21, 2026 02:47
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