Skip to content

[Console] Prevent concurrent duplicate start/cancel for Flink and Spark apps#4385

Closed
shangeyao wants to merge 1 commit into
apache:devfrom
shangeyao:fix/app-start-stop-concurrency-lock
Closed

[Console] Prevent concurrent duplicate start/cancel for Flink and Spark apps#4385
shangeyao wants to merge 1 commit into
apache:devfrom
shangeyao:fix/app-start-stop-concurrency-lock

Conversation

@shangeyao

Copy link
Copy Markdown
Contributor

Summary

  • Add pendingStarts / pendingCancels in-memory guards to reject duplicate operations
  • Use conditional lambdaUpdate to atomically transition application state to STARTING/CANCELLING
  • Clean up pending flags on async completion or submission failure

Fixes #4384

Test plan

  • Rapid double-click start on a Flink app — only one submission occurs
  • Rapid double-click cancel — second request is ignored with warn log
  • Auto-restart on failure still works

AI Disclosure

  • Model: Claude Opus 4.6
  • Platform/Tool: Cursor
  • Human Oversight: partially reviewed
  • Prompt Summary: Implement start/stop concurrency lock from dev branch optimization scan

Made with Cursor

Use pending operation sets and conditional DB state updates to prevent
duplicate start/cancel submissions under concurrent user actions.

Generated-by: Cursor
Co-authored-by: Cursor <cursoragent@cursor.com>
@shangeyao

Copy link
Copy Markdown
Contributor Author

Closing this PR because the StreamPark Console frontend is about to undergo a major refactor. These console-side changes would likely conflict with or require rework after the refactor. Will revisit relevant improvements once the new frontend architecture is in place.

@shangeyao shangeyao closed this Jun 30, 2026
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Console] Prevent concurrent duplicate start/cancel for Flink and Spark apps

1 participant