Skip to content

fix: serialize parsing for shared command CLIs - #3243

Closed
patrick-andstar wants to merge 1 commit into
alibaba:masterfrom
patrick-andstar:fix/synchronize-cli-parsing
Closed

fix: serialize parsing for shared command CLIs#3243
patrick-andstar wants to merge 1 commit into
alibaba:masterfrom
patrick-andstar:fix/synchronize-cli-parsing

Conversation

@patrick-andstar

Copy link
Copy Markdown

Summary

Serialize parsing and help metadata construction for a shared command CLI.

Fixes #2595

Motivation

Built-in commands are long-lived and AnnotatedCommandImpl caches their CLI descriptor. The middleware CLI parser sorts and iterates that descriptor's argument list during parsing. Concurrent HTTP API requests for the same command can therefore throw ConcurrentModificationException before command execution begins.

Changes

  • Resolve the CLI descriptor once per process run.
  • Synchronize its parse and help-metadata work on that descriptor.
  • Add a concurrent regression test using the shared MonitorCommand CLI.

Tests

  • Docker Desktop, Maven 3.9.9 / Eclipse Temurin JDK 17: mvn -V -ntp -pl core -Dtest=ProcessImplConcurrencyTest test (2 tests, 0 failures, 0 errors)

Notes

The lock is scoped to parsing a single shared command descriptor. It does not serialize command execution, instrumentation, or result delivery.

Duplicate Check

Checked open pull requests using: 2595, ConcurrentModificationException, and monitor. No open pull request fixes concurrent parsing of the shared command CLI.

@CLAassistant

CLAassistant commented Jul 21, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@patrick-andstar patrick-andstar closed this by deleting the head repository Aug 16, 2026
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.

使用http api并发调用2次不同的monitor命令时抛出并发修改arraylist的异常

2 participants