Skip to content

[ISSUE #15799] Sync develop into summer-ospp#15799 - #15937

Open
870255728 wants to merge 33 commits into
alibaba:summer-ospp#15799from
870255728:develop
Open

870255728 wants to merge 33 commits into
alibaba:summer-ospp#15799from
870255728:develop

Conversation

@870255728

Copy link
Copy Markdown

Synchronize the project baseline with the latest develop branch.

This brings upstream updates, including Agent visibility controls,
into summer-ospp#15799. Hub implementation changes will be submitted
separately.

KomachiSion and others added 30 commits September 10, 2026 20:29
…ntLinkedHashMap (alibaba#15840)

* For alibaba#15470, vendor ConcurrentLinkedHashMap for RPC ACK callbacks

Preserve the upstream implementation and attribution without depending on the Hessian utility package. Exclude the vendored sources from formatting and JaCoCo coverage, and add eviction and concurrency regression tests.

Assisted-by: Codex

* For alibaba#15470, upgrade SOFA JRaft to 1.4.1

Keep the gRPC transport independent of Bolt by constructing its server in the Nacos RPC factory. Preserve endpoint binding, message limits, parser registration and configuration helpers, with runtime gRPC regression tests and matching CP specs.

Assisted-by: Codex

* For alibaba#15470, migrate remaining Commons Lang 2 imports

Use the existing Commons Lang 3 dependency in naming, Istio and auth code/tests after JRaft 1.4.1 removes the transitive Commons Lang 2 dependency. Validate the complete release distribution and the affected test classes.

Assisted-by: Codex

* For alibaba#15470, limit disconnect lock cleanup to lock clients

Ignore non-lock and unlabeled connections before submitting lock cleanup to Raft. This avoids blocking shared gRPC IO threads when Naming clients disconnect. Add listener regressions and document the connection boundary in both lock specs.

Assisted-by: Codex
…rces (alibaba#15848)

* Restore Agent and MCP public defaults through visibility SPI

Use the default visibility plugin for Agent/MCP creation defaults, expose
independent Agent scope updates, and preserve scope on initial-draft retries.
Update matching specs, API/SDK coverage, tests, and packaged UI assets.

For alibaba#15847

Assisted-by: Codex

* Align Agent visibility integration coverage with the public default

Classify the Admin and Console scope operations in the authorization
inventory and update the initial Agent draft scope assertion to PUBLIC.
Synchronize the related coverage and scenario documentation.

Validation: 58 auth-enabled standalone OpenAPI IT cases passed; module
Spotless, Checkstyle, RAT, and SpotBugs checks passed.

For alibaba#15847

Assisted-by: Codex
…source (alibaba#15852)

The bundled conf/application.properties only shows the MySQL datasource
template and never mentions
`nacos.plugin.datasource.db.pool.config.driver-class-name`. When the
dialect is switched to postgresql/oracle by following the comments,
startup fails because the blank driver falls back to the MySQL driver:

  Driver com.mysql.cj.jdbc.Driver claims to not accept jdbcUrl, jdbc:postgresql://...

Align the bundled sample with the datasource dialect plugin spec and the
nacos.io datasource-plugin documentation:

- add a commented PostgreSQL URL example and a commented
  `pool.config.driver-class-name` example with a note that it is
  required for any non-MySQL dialect;
- sync bootstrap/src/main/resources/application.properties, which must
  stay identical to distribution/conf (ApplicationPropertiesConsistencyTest);
- clarify the `driver-class-name` row in the en/zh-cn datasource dialect
  plugin specs: the driver is not inferred from the dialect and must be
  set explicitly for non-MySQL dialects.

No runtime behavior change.

Assisted-by: Cursor Agent (Claude)
Remove untagged GetRequest/Log fallbacks and conversion helpers. Validate
request prefixes and types, retain protobuf parse causes, and add debug
diagnostics. Cover parser boundaries and state-machine replay failures,
and document the legacy log migration boundary in both CP specs.

Assisted-by: Claude Code
…configuration version (alibaba#15849)

* fix(console-ui-next): clarify rollback confirmation for first-insert version

Rolling back the first (insert) history version permanently deletes the
configuration, since there is no earlier state to restore. The confirmation
dialog previously showed the same generic "confirm rollback" wording and a
plain "Confirm" button for this case, which repeatedly confused users into
thinking rollback would restore rather than delete (alibaba#2731, alibaba#4064, alibaba#5358).

For insert-type rollback, the dialog now explains that the config will be
deleted and the confirm button reads "Confirm Delete Configuration" with a
destructive style, instead of the ambiguous generic confirmation.

Assisted-by: Claude Code

* fix(console-ui-next): correct insert-rollback wording per review

opType === 'I' can also come from a delete-then-recreate, not only a
true first publish - a normal delete keeps its own history (a D record)
and is restorable within the retention window, so claiming the
configuration will be "permanently" deleted with "no earlier history"
overclaims and can mislead users who could otherwise recover it.

Reworded to describe the actual rollback semantics instead: it restores
the state before the selected insert operation, i.e. before the config
existed, which is why the current configuration gets deleted.

Assisted-by: Claude Code
…d SDKs (alibaba#15860)

* Consolidate Agent models and version summaries

Unify Agent and RAD Java model packages, share request fields, and consolidate
resource and version summaries. Update SDK, server, Console, schemas and
integration-test contracts, preserving historical A2A public models.

Record the reviewed endpoint consolidation design and regression test plan
for a separate implementation step.

Validation: Spotless apply/check, 48-module test compilation, and 3007 passing
focused unit tests (one existing skip). Two local-port tests passed after
rerunning outside the restrictive sandbox. Previous IT and frontend evidence
is recorded in MODEL_VALIDATION.md.

Assisted-by: Codex

* Unify Agent endpoint models and request packages

Consolidate definition, discovery and runtime endpoint views into shared
AgentCallInterface, EndpointSet and Endpoint models. Adapt storage, migration,
indexing, artifacts, SDKs, Console and the corresponding schemas and tests.

Organize admin and client requests into dedicated packages, share namespace-free
search and registration models, and expose partial deregistration through
agentName, protocol and endpoint arguments. Preserve namespace in request
context and publication redo identity.

Validation: refreshed Spotless apply/check and reactor test compilation;
previous full matrix recorded 4985 passing unit tests, 3 existing skips,
87 passing frontend tests, and 236 passing external IT cases. Three independent
Console error-code assertions remain failing and 23 existing IT cases skipped.
Defer CONSOLE-ERR-01 until the current model review is complete.

Assisted-by: Codex

* Remove Jackson annotations from Agent models and simplify schemas

Use explicit Endpoint defaults and non-bean AgentVersionInfo helpers, align
RAD, management and artifact contracts at 0.3.0, and keep one current public
schema at stable paths. Update serialization, UI and API/SDK test coverage.

Validation: full Agent matrix (4992 UT; 262 external cases with the 3 known
independent Console failures), frontend tests/build, release build and static
checks. Rechecked affected-module Spotless and 8 schema contract tests.

Assisted-by: Claude Code

* Preserve Admin business errors through independent Console

Keep the HTTP status, business code, summary and detail in NacosApiException
when the Maintainer HTTP proxy exhausts retries. Parse ordinary HTTP and
multipart error bodies without changing retry or authentication policy.

Validate legacy A2A/Pipeline fallback and both Console deployment modes.
All 14 Agent/A2A cases now pass in each mode; record the separate pre-existing
Naming cluster lookup difference using an old-build comparison.

Validation: 386 unit tests passed; both Maintainer adapters passed 44 IT each
with 2 existing skips each; release build and static checks passed.

For alibaba#14804

Assisted-by: Claude Code
…baba#15858)

* fix: return schema in configuration detail APIs

* fix: remove @JsonInclude
…JDBC driver (alibaba#15856)

* [ISSUE alibaba#15851] Let datasource dialect plugins provide default JDBC driver

Follow-up of alibaba#15852. Selecting a dialect via
`nacos.plugin.datasource-dialect.type` used to be insufficient for any
non-MySQL database: `ExternalDataSourceProperties` hard-coded
`com.mysql.cj.jdbc.Driver` whenever
`nacos.plugin.datasource.db.pool.config.driver-class-name` was blank, so
PostgreSQL/Oracle users had to configure the driver separately or hit
"Driver com.mysql.cj.jdbc.Driver claims to not accept jdbcUrl".

Keep the driver knowledge inside the dialect plugins instead of the core:

- `DatabaseDialect` gains `default String getDefaultDriverClassName()`
  returning `null`, so third-party dialects compiled against older
  versions keep working.
- The built-in mysql / postgresql / oracle / derby dialects return
  `com.mysql.cj.jdbc.Driver`, `org.postgresql.Driver`,
  `oracle.jdbc.OracleDriver` and `org.apache.derby.jdbc.EmbeddedDriver`.
- `ExternalDataSourceProperties` asks the selected dialect first when the
  pool config driver is blank and falls back to the MySQL compatibility
  default only when the dialect cannot be resolved, is disabled, or
  provides no driver. An explicitly configured driver still wins.
- `DatasourcePlatformUtil` gains an `Environment`-based overload so the
  dialect can be resolved from the same environment used for the
  datasource properties.
- Update the en/zh-cn datasource dialect plugin spec (SPI table, driver
  resolution rules, `driver-class-name` row) and the bundled
  application.properties comment accordingly.

Verified against PostgreSQL 17 in standalone mode without any
`driver-class-name` configured: the log reports
"Use default driver class name `org.postgresql.Driver` provided by
DatabaseDialect `postgresql`" and Nacos starts with
datasource_platform=postgresql.

Assisted-by: Cursor Agent (Claude)

* [ISSUE alibaba#15851] Fix default JDBC driver lookup during datasource reload

Reuse the datasource type resolved at initialization and query the dialect default only when no driver is explicitly configured. Add canonical and legacy configuration regression coverage and clarify the English and Chinese specs.

Assisted-by: Codex
…5842)

* feat(naming): add independent DNS server module for service discovery

Move DNS server implementation to an independent 'dns' module
that depends on naming module, following the same pattern as 'address' module.

Fixes alibaba#50

Features:
- Standard A record query support
- UDP and TCP transport
- Healthy instance filtering
- Configurable port (default 5353)
- Domain format: {serviceName}.{groupName}.nacos

* feat(naming): add dns module dependency to server

* feat(naming): add dns module to dependencyManagement

* fix(dns): harden DNS server for production use

- Upgrade dnsjava to 3.6.0 to address known CVEs
- Fix UDP receive buffer race: copy per-packet data before async processing
- Cap UDP response at 512 bytes with TC bit to prevent amplification attacks
- Separate listener threads from worker pool (bounded queue)
- Add TCP socket timeout (5s) and max connection limit (64)
- Shuffle answers for basic round-robin, cap at 20 records
- Validate query class (IN only), graceful shutdown
- Larger UDP receive buffer (4096) for EDNS queries

* test(dns): expand unit tests to cover all edge cases

Add 11 new test cases covering:
- Null question, non-IN class, non-A type queries
- Domain suffix mismatch, default group, explicit group
- Healthy/enabled instance filtering
- Null service info, naming exception handling
- Answer record limit (capped at 20)
- Response flags (QR, RA)
- AAAA with no IPv6 instances

* fix(dns): bind UDP and TCP to same port, add integration tests

- Bind UDP first, then TCP to the same actual port (supports ephemeral port=0)
- Add NacosDnsServerTest with 3 integration tests:
  - Small UDP response not truncated
  - TCP retrieval returns A records
  - Large instance set (50) capped at 20 records

* style(dns): add @PreDestroy for graceful shutdown, remove unused imports

* fix(dns): filter by record type before limit, separate TCP/UDP worker pools

1. QueryHandler: filter addresses by requested record type (A/AAAA)
   BEFORE shuffle and limit, so mixed IPv4/IPv6 deployments return
   matching records instead of empty answers.

2. Server: separate UDP and TCP worker pools (16 + 8 threads).
   Slow TCP connections can no longer exhaust the shared pool and
   block UDP queries. TCP pool has smaller queue (256) and thread count.

* fix(dns): enforce absolute TCP receive deadline per RFC 7766

Instead of relying solely on SO_TIMEOUT (which resets on every read),
track an absolute deadline covering both the 2-byte length prefix and
the complete message body. Each read uses the remaining time budget
and the connection is closed when the budget expires. The idle deadline
is reset only after a complete DNS message is received (RFC 7766 §6.2.3).

This prevents slowloris-style attacks where a client sends one byte
per second, which would otherwise keep the worker occupied indefinitely
even with SO_TIMEOUT set.

* refactor(dns): extract deadline helpers from handleTcpConnection

Extract checkDeadline() and readByteWithDeadline() to remove duplicated
deadline-check / setSoTimeout boilerplate from the TCP read loop.

* test(dns): add regression tests per review feedback

- Mixed IPv4/IPv6: 100 IPv4 + 1 IPv6 queried via AAAA returns the IPv6
- Mixed IPv6/IPv4: 100 IPv6 + 1 IPv4 queried via A returns the IPv4
- Slow TCP frame (1 byte of length prefix) closed within absolute deadline
- UDP remains responsive while all TCP workers are occupied

* style(dns): cleanup imports, fix error port log, cleanup pools on bind failure

- Import Flags and Section instead of using fully qualified names
- Fix TCP listener error log to use actual bound port
- Shut down worker pools if TCP bind fails (resource leak)

* style(dns): remove unused assertNotNull import (checkstyle)

* style(dns): apply spotless formatting
…tion (alibaba#15863)

* [ISSUE alibaba#14804] Adapt A2A clients to RAD with transport negotiation

Resolve Client HTTP capabilities and select the A2A compatibility mode per
client instance. Adapt Card reads, publication, endpoint intents and Watch
to RAD while preserving the legacy gRPC path for older servers.

Implement Client first-version submission, draft replacement and non-draft
no-op semantics. Align endpoint defaults, source preferences, migration
admission, Console behavior and the 0.5.0 public schemas. Return current
Agent description and tags without extra discovery queries.

Cover both public entries, transports, JSON adapters and real old-server,
migration, restart and cluster fixtures. Keep local design notes out of
the published change.

Assisted-by: Codex

* [ISSUE alibaba#14804] Respect auth mode in A2A migration catalog checks

Use a regular Client identity for ARD only when test authentication is
enabled. Keep the dedicated migration workflow's no-auth requests anonymous
instead of failing before the HTTP request is sent.

Document both fixture modes. Validate three syncing cross-surface scenarios
with authentication disabled and enabled; both runs pass with two other
phase-specific tests skipped in each run.

Assisted-by: Codex

* [ISSUE alibaba#14804] Cover A2A RAD capability, publication and Watch boundaries

Add 50 unit-test scenarios across existing tests for capability negotiation,
A2A Card projection, endpoint redo reconciliation, Watch lifecycle and
terminal failures, and non-repeatable HTTP request boundaries.

Keep production behavior unchanged. Validate all tests in api, common, ai,
client and default-auth-plugin, together with Spotless, RAT, Checkstyle
and SpotBugs. Local JaCoCo resolves 82 of the 100 Codecov patch gaps.

Assisted-by: Codex
…SecurityProxy shutdown (alibaba#15867)

* [ISSUE alibaba#15866] Deregister ServerListChangeEvent subscriber on SecurityProxy shutdown

- SecurityProxy keeps the subscriber reference and deregisters it in
  shutdown(), avoiding the leaked subscription and event callbacks that
  run after the server list manager has been closed.
- AbstractServerListManager.getServerList() returns an empty list
  instead of throwing NPE when the provider is null after shutdown.

* [ISSUE alibaba#15866] Shut down SecurityProxy in NacosLockService and NacosNamingMaintainService

Both lifecycles omitted securityProxy.shutdown(), so these clients never
deregistered the ServerListChangeEvent subscriber. Shut it down like the
other client implementations.

- NacosLockServiceTest: verify the subscriber is removed from the share
  publisher after shutdown.
- NacosNamingMaintainServiceTest: verify securityProxy.shutdown() is invoked.
…es (alibaba#15862)

* fix: return cached frontmatter in Skill list responses

* feat: Make frontmatter cache refresh best-effort: do not fail lifecycle operation on CAS conflict after primary metadata persisted, only log failures

* feat: Store a bounded custom-field snapshot for list responses

* feat: Handle malformed historical metadata defensively
…fields in subscriber list (alibaba#15874)

Co-authored-by: lzcGeek <lzcGeek@users.noreply.github.com>
…alization (alibaba#15889)

* [ISSUE alibaba#15836] Register plugin availability RPC payloads

Register plugin availability requests and responses so remote cluster probes
can be decoded. Add codec regression tests, strengthen Console API coverage,
and update the English and Chinese RPC specifications.

Assisted-by: Codex

* [ISSUE alibaba#15836] Make core test initialization independent of execution order

Initialize and restore Distro environment state before static executor mocking.
Use mocked task engines and assert scheduled tasks without leaking worker pools.
Provide complete auth configuration before RPC filter/client and JRaft server construction so
cold JVMs do not poison the shared auth holder and cascade failures.

Assisted-by: Codex
…ibaba#15879)

Bump agentscope-core and agentscope-extensions-studio to 2.0.3, add agentscope-extensions-model-dashscope, and move the DashScopeChatModel import to io.agentscope.extensions.model.dashscope, since 2.0 moved model providers out of core. Add a test for the Msg construction shapes Copilot uses, as 2.0 validates content against role. Behavior is unchanged: still DashScope-only and still on stream().
…pshot to avoid truncating redo registrations on cluster restart (alibaba#15875)
…libaba#15901)

Generate a UUID for each SDK HTTP request without mutating caller headers.
Propagate the ID into the server request context with fallback and cleanup
coverage, and document the client/server contract.

Assisted-by: Codex
…r reconnect (alibaba#15880)

* [ISSUE alibaba#15876] Fix ephemeral instance never re-registered after reconnect

NamingGrpcRedoService marks an instance as registered as soon as the register
RPC returns, without checking whether the connection it was sent on is still
the current one. During a gRPC reconnect storm the disconnect callback can be
applied first (marking everything for redo), and a late success response from
the now-dead connection then flips registered back to true. RedoType becomes
NONE, so the redo task skips it forever, while the server has already removed
the ephemeral instance for the dead connection. Client and server stay out of
sync until the process restarts.

Snapshot the connection generation (epoch) before sending the register request
and ignore the response when the generation has changed by the time it arrives,
so a stale ack can no longer overwrite the redo mark. Skipping is the safe
direction: worst case is one extra idempotent re-register on the next redo pass.
Both the single-instance and batch register paths are covered.

* [ISSUE alibaba#14804] Fix flaky A2aMigrationReconciliationTaskTest startup scheduling test

startupShouldScheduleActiveReconciliationWithConfiguredInterval relied on a real ScheduledExecutorService and only waited for getNamespaceList() via timeout(2000). The background reconciliation could still be scanning when the test returned, so the listMigratedAgentNames() stub was occasionally left unused and Mockito strict afterEach check threw UnnecessaryStubbingException.

Replace the real executor with a mock, capture the scheduled Runnable, assert scheduleWithFixedDelay(0, 3600, SECONDS), then run the task synchronously and verify the scan, progress persistence and lease release. This keeps the interval assertion and removes the thread-scheduling race.
…#15871)

* [Enhancement] Support disabling config snapshots by property

* [Enhancement] Align snapshot property with client naming

Use the camelCase property key expected by the client property API and exercise that literal key in the regression test.

Assisted-by: OpenAI Codex

* [ISSUE alibaba#15868] Isolate config snapshot switch tests

Mock snapshot cleanup to avoid disk side effects and restore the original property and switch state after each test. Cover the default setting and cleanup behavior for enabled and disabled startup configuration.

Assisted-by: Reasonix (DeepSeek)

* fix(config): tolerate snapshot startup cleanup failures

Assisted-by: DeepSeek
…n Copilot (alibaba#15898)

Behavior-preserving: rewrite StreamEventProcessor for typed AgentEvent deltas and switch the four call sites off deprecated stream().
Keep provider discovery working without Jackson 2 and remove direct Jackson 2
usage from client authentication. Add isolated runtime tests and SDK IT coverage.

Assisted-by: Codex
…ding (alibaba#15877)

* feat(naming): add independent DNS server module for service discovery

Move DNS server implementation to an independent 'dns' module
that depends on naming module, following the same pattern as 'address' module.

Fixes alibaba#50

Features:
- Standard A record query support
- UDP and TCP transport
- Healthy instance filtering
- Configurable port (default 5353)
- Domain format: {serviceName}.{groupName}.nacos

* feat(naming): add dns module dependency to server

* feat(naming): add dns module to dependencyManagement

* fix(dns): harden DNS server for production use

- Upgrade dnsjava to 3.6.0 to address known CVEs
- Fix UDP receive buffer race: copy per-packet data before async processing
- Cap UDP response at 512 bytes with TC bit to prevent amplification attacks
- Separate listener threads from worker pool (bounded queue)
- Add TCP socket timeout (5s) and max connection limit (64)
- Shuffle answers for basic round-robin, cap at 20 records
- Validate query class (IN only), graceful shutdown
- Larger UDP receive buffer (4096) for EDNS queries

* test(dns): expand unit tests to cover all edge cases

Add 11 new test cases covering:
- Null question, non-IN class, non-A type queries
- Domain suffix mismatch, default group, explicit group
- Healthy/enabled instance filtering
- Null service info, naming exception handling
- Answer record limit (capped at 20)
- Response flags (QR, RA)
- AAAA with no IPv6 instances

* fix(dns): bind UDP and TCP to same port, add integration tests

- Bind UDP first, then TCP to the same actual port (supports ephemeral port=0)
- Add NacosDnsServerTest with 3 integration tests:
  - Small UDP response not truncated
  - TCP retrieval returns A records
  - Large instance set (50) capped at 20 records

* style(dns): add @PreDestroy for graceful shutdown, remove unused imports

* fix(dns): filter by record type before limit, separate TCP/UDP worker pools

1. QueryHandler: filter addresses by requested record type (A/AAAA)
   BEFORE shuffle and limit, so mixed IPv4/IPv6 deployments return
   matching records instead of empty answers.

2. Server: separate UDP and TCP worker pools (16 + 8 threads).
   Slow TCP connections can no longer exhaust the shared pool and
   block UDP queries. TCP pool has smaller queue (256) and thread count.

* fix(dns): enforce absolute TCP receive deadline per RFC 7766

Instead of relying solely on SO_TIMEOUT (which resets on every read),
track an absolute deadline covering both the 2-byte length prefix and
the complete message body. Each read uses the remaining time budget
and the connection is closed when the budget expires. The idle deadline
is reset only after a complete DNS message is received (RFC 7766 §6.2.3).

This prevents slowloris-style attacks where a client sends one byte
per second, which would otherwise keep the worker occupied indefinitely
even with SO_TIMEOUT set.

* refactor(dns): extract deadline helpers from handleTcpConnection

Extract checkDeadline() and readByteWithDeadline() to remove duplicated
deadline-check / setSoTimeout boilerplate from the TCP read loop.

* test(dns): add regression tests per review feedback

- Mixed IPv4/IPv6: 100 IPv4 + 1 IPv6 queried via AAAA returns the IPv6
- Mixed IPv6/IPv4: 100 IPv6 + 1 IPv4 queried via A returns the IPv4
- Slow TCP frame (1 byte of length prefix) closed within absolute deadline
- UDP remains responsive while all TCP workers are occupied

* style(dns): cleanup imports, fix error port log, cleanup pools on bind failure

- Import Flags and Section instead of using fully qualified names
- Fix TCP listener error log to use actual bound port
- Shut down worker pools if TCP bind fails (resource leak)

* style(dns): remove unused assertNotNull import (checkstyle)

* style(dns): apply spotless formatting

* feat(dns): add SRV records, metrics, and external DNS forwarding

- Add SRV record query support (priority/weight/port/target per instance)
- Add NacosDnsMetrics with Micrometer counters and timer
- Add NacosDnsForwarder for non-Nacos domain forwarding to upstream DNS
- Add forwardEnabled/forwardServers/forwardTimeoutMs config properties
- Add resolveQuery() routing in NacosDnsServer (local vs forward)
- Add tests for SRV records, suffix matching, and forwarding

* test(dns): add forwarder unit tests, SRV edge cases, and non-Nacos domain test

- Add NacosDnsForwarderTest (4 tests: disabled, no servers, empty, unreachable)
- Add SRV tests: default weight=0, glue records in additional, no healthy instances
- Add non-Nacos domain returns NXDOMAIN test
- Add Server integration test for non-Nacos domain with forwarding disabled

* fix(dns): address self-review findings

- Fix metrics: recordQuery() now in resolveQuery() so forwarded queries are counted
- Fix TCP connection limit: use atomic incrementAndGet() instead of check-then-act
- Fix parseIpAddress: IPv4 uses byte parsing to avoid DNS lookup; IPv6 safe via colon check
- Fix SRV IPv6 target: use full expanded form to avoid illegal leading hyphen
- Fix SRV port validation: skip instances with port outside 0-65535
- Fix exception handling: doHandleQuery exceptions return SERVFAIL and recordFailed

* feat(dns): add type and rcode tags to query duration timer

- Replace single untagged Timer with tagged Timers (type, rcode)
- type tag bounded to A/AAAA/SRV/OTHER/UNKNOWN
- rcode tag uses standard DNS response code names (NOERROR/NXDOMAIN/SERVFAIL/...)
- Local queries timed in handleQuery(); forwarding path timed in resolveQuery()
- Timer instances cached in ConcurrentMap to avoid repeated registry lookups
- Domain names never used as tags (cardinality safety)

* fix(dns): make metrics optional so DNS server starts without actuator

- Remove @component from NacosDnsMetrics to avoid forced MeterRegistry injection
- NacosDnsMetrics constructor accepts null registry, falls back to SimpleMeterRegistry
- Define NacosDnsMetrics bean in AutoConfiguration via ObjectProvider<MeterRegistry>
- DNS server now works without spring-boot-starter-actuator on classpath

* refactor(dns): use Timer.Sample and add forward timeout lower bound

- Replace manual nanoTime + TimeUnit with Micrometer Timer.Sample (startSample/stopSample)
- Timer.Sample encapsulates clock and unit conversion, no mutable Timer exposed
- Add MIN_FORWARD_TIMEOUT_MS=100 clamp: Duration.ZERO means infinite wait in dnsjava
- Remove unused recordQueryDuration() and TimeUnit import

* refactor(dns): harden DNS forwarder per P0 review

P0 fixes:
- ForwardResult with ForwardStatus enum: DISABLED/NO_SERVERS/INTERNAL_SUFFIX/SUCCESS/UPSTREAM_FAILURE
- Upstream failure returns SERVFAIL (not NXDOMAIN) to avoid poisoning client negative caches
- Absolute time budget: total = 2x per-server timeout, each upstream gets remaining budget
- SimpleResolver cached by host:port (no per-query socket creation)
- Support host:port and [ipv6]:port server specs, validated at construction (fail-fast)
- Upstream rcode filtering: only NOERROR/NXDOMAIN accepted, SERVFAIL/REFUSED try next
- Forward metrics: queries.total/success/failed + forward.duration timer (server/result tags)
- bind-address defaults to 127.0.0.1 (prevents open resolver abuse)
- Defensive internal suffix check in forwarder
- Null query guard
- Warn-level logging with e.toString() (not e.getMessage() which may be null)
- Immutable server list copied at construction

P2 fixes:
- Extract createResolver() protected method for testability
- Error responses no longer set RA flag (conditional forwarder, not recursive resolver)

Tests: 13 forwarder tests (success, fallback, SERVFAIL, budget, null, suffix, port parsing)
+ 1 server regression test (upstream failure -> SERVFAIL)

* fix(dns): clamp SRV weight to 16-bit range and clean up worker pools on UDP bind failure

- SRV weight is 16-bit unsigned (0-65535); Nacos Instance.getWeight() can exceed.
  Previously caused IllegalStateException -> SERVFAIL for entire query.
  Now clamped to 65535 with warn log, default 1 when <=0.
- UDP bind failure now shuts down udpWorkerPool/tcpWorkerPool, matching
  the TCP bind failure cleanup path.
- Add test: weight=100000 returns NOERROR with clamped weight=65535.

* fix(dns): address review items 5-11 (resolver race, rcode, RA, budget, TCP size, IPv6, validation)

- Item 5: Remove shared SimpleResolver cache; create per-request resolver to
  avoid setTimeout race between concurrent queries with different time budgets.
- Item 6: buildTruncatedResponse now preserves original rcode (was always NOERROR).
- Item 7: Unify RA flag strategy — conditional forwarder never sets RA
  (removed from doHandleQuery, catch block, and truncated response).
- Item 8: Simplify totalBudgetMs to perServerTimeoutMs * 2 (remove dead Math.max).
- Item 9: Add TCP_MAX_MESSAGE_SIZE=65535 (RFC 1035), replace UDP constant in TCP path.
- Item 10: Reject bare IPv6 (multiple colons, no brackets) with clear error
  message requiring [ipv6]:port notation.
- Item 11: Add @PostConstruct validation: when enabled, domainSuffix non-empty,
  port in [0,65535], ttl non-negative (fail-fast).
- Tests: bare IPv6 rejection, bracketed IPv6 acceptance, RA-not-set assertion.
- 47 tests pass, spotless/checkstyle clean.

* refactor(dns): create worker pools after socket bind succeeds

Move ThreadPoolExecutor creation to after both UDP and TCP sockets are
bound. This eliminates the need for shutdownNow() cleanup in the bind
failure catch blocks — if binding fails, no pools exist yet.
TCP bind failure still closes the UDP socket.

47 tests pass, spotless/checkstyle clean.

* fix(dns): address 8 review comments - metrics, FORMERR, forward pool, case-insensitive suffix, parsing tests

- recordForwarded() called in resolveQuery; SUCCESS calls recordSuccess(), UPSTREAM_FAILURE calls recordFailed()
- qdcount=0 returns FORMERR instead of falling to forwarding path
- Forwarding offloaded to dedicated forwardWorkerPool (4 threads) to isolate slow upstreams from local queries
- Suffix matching case-insensitive (RFC 4343) in both Forwarder and QueryHandler
- parseIpAddress warns on non-IP hostname instances instead of silent drop
- Forwarder exposes getParsedServers(); parsing tests assert actual host/port
- Added server-level forward success test, FORMERR test, case-insensitive test, default port test
- 51 tests pass

* fix(dns): bare suffix must match locally (review comment alibaba#5 follow-up)

matchesSuffix() and matchesInternalSuffix() now also match the bare suffix
itself (e.g. 'nacos'), not just subdomains ('svc.nacos'). Previously a
query for the bare suffix would fall through to upstream forwarding.
Both methods use case-insensitive comparison (RFC 4343).

- Added tests: testBareSuffixRejected, testInternalSuffixCaseInsensitiveRejected
- Updated testDoesNotMatchSuffix: bare suffix now matches (was incorrectly
  asserting non-match)
- 53 tests pass, spotless/checkstyle clean

* test(dns): add end-to-end forwarding test with real stub UDP upstream

Replaces the stub-forwarder-only success test with a true integration test
that exercises the full path: client UDP -> NacosDnsServer ->
forwardWorkerPool -> SimpleResolver -> stub UDP upstream -> back.

The stub upstream is a real DatagramSocket that replies with a canned
NOERROR+A record (203.0.113.10). The test asserts:
- Transaction ID preserved end-to-end
- Answer record matches stub upstream response
- Stub upstream received exactly one query
- NOERROR rcode relayed to client

54 tests pass, spotless/checkstyle clean

* fix(dns): address 3 review comments - shared suffix matcher, SRV target resolution, upstream address pre-resolution

1. Shared case-insensitive suffix matcher (DnsNameUtil):
   - Extracted to shared utility used by both QueryHandler and Forwarder
   - Only lowercases for comparison; original case preserved for Nacos
     service/group lookup (which has its own case semantics)
   - Matches both bare suffix and subdomains (RFC 4343)

2. SRV targets independently resolvable:
   - parseSrvTargetAddress() parses IP from SRV target naming convention
     (10-0-0-1.nacos -> 10.0.0.1, IPv6 expanded form -> IPv6)
   - A/AAAA queries for SRV target names return the encoded IP directly,
     so clients resolving targets separately (not via Additional section)
     can reach the instance
   - IP family mismatch (A query for IPv6 target) returns NXDOMAIN

3. Upstream hostname resolution in timeout budget:
   - ServerAddress now stores pre-resolved InetAddress
   - Addresses resolved at construction with controlled timeout via
     separate executor + Future.get(timeout)
   - createResolver() uses InetAddress directly, avoiding uncontrolled
     InetAddress.getByName() inside SimpleResolver constructor
   - Remaining budget recalculated after resolver construction, before send

- Added tests: SRV target IPv4/IPv6 resolution, wrong family returns NXDOMAIN,
  service lookup still works after target handling
- 58 tests pass, spotless/checkstyle clean

* fix(dns): case-insensitive suffix in resolveInstances + bare suffix guard

resolveInstances() used case-sensitive endsWith() for suffix matching, so
SVC.NACOS would pass the server-level matchesSuffix check but return NXDOMAIN
from service lookup. Now uses DnsNameUtil.matchesSuffix() while preserving
original case for service/group name extraction.

Added guard: bare suffix query (empty servicePart) returns null instead of
attempting to look up an empty service name.

Added test: testMixedCaseServiceLookupResolvesInstances
59 tests pass, spotless/checkstyle clean

* fix(dns): address 6 review comments from KomachiSion

1. NODATA for SRV targets without requested address family:
   When parseSrvTargetAddress() recognizes a target but the address family
   doesn't match (e.g. AAAA query for IPv4 target), return NOERROR with the
   original Question and empty Answer section (NODATA), instead of falling
   through to service lookup and returning NXDOMAIN. This prevents Go's
   LookupHost from waiting the full deadline.

2. Reserved prefix for SRV targets to avoid service name collisions:
   SRV targets now use '_nacos-ip-' prefix (e.g. _nacos-ip-10-0-0-1.nacos).
   A service literally named '10-0-0-1' is no longer intercepted by the
   target decoder. parseSrvTargetAddress() only recognizes names with the
   reserved prefix.

3. Periodic upstream hostname refresh:
   - Store original configured specs separately from resolved snapshot
   - AtomicReference<List<ServerAddress>> for thread-safe snapshot swap
   - ScheduledExecutorService re-resolves all upstreams every 5 minutes,
     including those that previously failed
   - @PreDestroy close() shuts down the refresh executor

4. Async forwarding releases UDP workers:
   - handleUdpQuery() submits forward+send to forwardWorkerPool and returns
     immediately; UDP worker no longer blocks on future.get()
   - forwardAndSendUdp() runs on forward pool, calls forwarder.forward()
     directly (no nested pool submission — avoids deadlock), sends response
   - TCP still uses resolveQuerySync() (TCP has its own worker pool)
   - Added regression test: local query completes while forward pool saturated

5. Locale-independent suffix matching:
   DnsNameUtil.matchesSuffix() uses toLowerCase(Locale.ROOT) to avoid
   Turkish-locale dotted-I issues.

6. Bare-suffix queries handled before substring:
   Both parseSrvTargetAddress() and resolveInstances() check
   domain.length() <= suffix.length() before subtracting, preventing
   StringIndexOutOfBoundsException for bare suffix queries (nacos. A/AAAA/SRV).

Tests: 63 pass (4 new SRV target/NODATA/collision/bare-suffix + 1 async),
spotless/checkstyle clean

* fix(dns): defensive null check in forwardAndSendUdp catch block

question could theoretically be null if forwardAndSendUdp is ever called
without the handleUdpQuery pre-filter. Use ternary to avoid NPE in error
logging.

* fix(dns): address 3 new P2 review comments from KomachiSion

1. Use jakarta.annotation.PreDestroy for the refresh executor:
   The component imported javax.annotation.PreDestroy, which Spring Boot 4 /
   Spring 7 no longer processes. In a real AnnotationConfigApplicationContext
   test, close() was never invoked and the scheduled task leaked. Switched to
   jakarta.annotation.PreDestroy (consistent with NacosDnsServer) and added a
   regression test asserting closing the context shuts down the executor.

2. Distinguish 'no upstream configured' from 'temporarily unresolved':
   When configured upstream hostnames fail to resolve, the snapshot becomes
   empty and the old code returned NO_SERVERS -> NXDOMAIN. That poisons client
   negative caches for domains that may well exist. originalSpecs empty ->
   NO_SERVERS (NXDOMAIN); originalSpecs non-empty but snapshot empty ->
   UPSTREAM_FAILURE (SERVFAIL). Added Forwarder and Server (UDP + TCP)
   regression tests. Also made the 5-minute refresh interval configurable
   (nacos.naming.dns.forward-refresh-interval-seconds, min 10s, default 300s).

3. Match the SRV target prefix case-insensitively:
   startsWith() made _nacos-ip- case-sensitive, so _NACOS-IP-10-0-0-1.NACOS
   fell through to service lookup and returned NXDOMAIN (without a Question).
   Use regionMatches(true, 0, SRV_TARGET_PREFIX, ...) which is
   Character-level, locale-independent, and preserves ordinary service-name
   case. NXDOMAIN responses now also echo the Question (RFC 1035 4.1.2).
   Added mixed-case IPv4 and IPv6 target tests.

Tests: 69 pass (6 new), spotless/checkstyle clean
…ty (alibaba#15927)

* Add public Agent discovery capability query

Expose target-scoped RAD capability evidence through AiService without
selecting or changing the legacy A2A route. Preserve UNKNOWN and probe
errors, reuse current negotiation and HTTP caching, and reject queries
after shutdown.

Clarify first-Version submission, Endpoint replacement and legacy A2A
listener behavior in Javadoc. Update bilingual SDK specs and IT matrices.

Validation: Spotless apply/check; 257 unit tests; SDK IT compilation;
20 current-server and 12 released 3.2.3-server SDK IT executions across
default JSON and Jackson 3. Incremental UT line/branch coverage: 100%.

Assisted-by: Codex

* Add explicit A2A discovery snapshot converter

Expose AgentConverter and an offline A2A factory with an AgentService getter.
Project the first retained nonempty endpoint source, preserve snapshot order,
isolate mutable output and report conversion failures with safe diagnostics.
Keep legacy A2A selection and native discovery/listener dispatch unchanged.

Update bilingual specs, Javadoc, SDK scenarios and coverage records.
Validation: 1,547 AI unit tests passed, one pre-existing disabled MCP case;
126 SDK IT executions passed across default JSON and Jackson 3, eight
restart/cluster-fixture cases skipped. P03 line/branch/instruction coverage
is 100%. Spotless, Checkstyle, RAT and API SpotBugs passed.

Assisted-by: Codex

* Deliver initial Agent Watch state through the listener

Make both native subscribeAgent overloads void and initialize new listeners
through the existing serialized dispatcher. Atomically register initial
notifications so later state cannot be overwritten by stale initialization.
Reuse existing wire fingerprint refresh and preserve legacy A2A return values.

Update bilingual specs, Javadoc, SDK callers and scenario matrices.
Validation: 1,559 AI UT and 154 default/Jackson 3 SDK IT passed; one existing
MCP UT and eight fixture-dependent IT skipped. All 13 WINIT plan groups passed.
Incremental UT lines 17/17, branches 16/16, instructions 95/95. Spotless,
compile, Checkstyle, SDK package and RAT passed. Callback rejection redelivery
and persistent remote recovery remain separately planned work.

Assisted-by: Codex

* Preserve Agent Watch subscriptions and deliver latest listener state

Retain accepted subscriptions across background failures and reserve
UNAVAILABLE for confirmed Agent absence. Recover rejected background tasks
and preserve acknowledged HTTP watches while retrying quota-limited growth.

Coalesce callback delivery to the latest state, retry executor rejection and
getExecutor failures, and isolate slow or throwing listeners. Compose Watch
state and listener delivery outside the manager, improve failure diagnostics,
and document gRPC, HTTP long polling and Discover polling behavior.

Update bilingual specs, public Javadoc, SDK integration tests and coverage
records. Validation: 1,629 AI unit tests and 178 default/Jackson 3 SDK IT
executions passed, including two real standalone restarts with clients alive.
One existing UT is disabled and six multi-node IT executions are skipped;
real migration fixtures are not exercised. Incremental UT coverage is 100%
of lines, 95.86% of branches and 99.66% of instructions. Spotless, compilation,
Checkstyle, RAT and release packaging passed.

Assisted-by: Codex

* Verify Agent SDK recovery and server-first upgrade compatibility

Add a real persisted-data upgrade fixture from 3.2.3 to 3.3.0-RC,
covering legacy A2A reads, writes and subscriptions before and after
client recreation, followed by native RAD operations.

Fix cluster restart assertions to verify retained endpoint redo, use
the actual current SDK location for binary compatibility checks, and
add capability-to-discovery-to-conversion assertions. Record the core
behavior matrix and align testing specs with persistent Watch recovery.

Validation: all 48 core UT/IT behavior groups covered, including the
real upgrade and three cluster workflows. Spotless apply/check, test
compilation, Checkstyle and RAT pass before commit.

Assisted-by: Claude Code

* Keep Agent SDK integration tests scoped to fixed workflows

Remove the local binary-upgrade fixture, harness and acceptance report from
the repository. Preserve their latest versions as local validation artifacts.
Keep functional, error, recovery and migration tests selected by the existing
Actions workflows, and replace branch execution diaries with stable scenario,
assertion and workflow mappings.

Validation: Spotless apply/check, clean test compilation, Checkstyle and RAT
passed. Retained functional test sources and production code are unchanged.

Assisted-by: Claude Code

* Align Agent SDK coverage with fixed CI workflows

Remove the remaining local capability-run diary and restore optional binary
compatibility fixture changes to the upstream baseline. Preserve those local
verification changes outside version control. Correct the workflow mapping
and replace the stale validation-section reference with the functional matrix.

Validation: full CI-equivalent 62-module checks, 1,629 AI unit tests with one
existing skip, and SDK IT test compilation pass. Changed-line UT coverage is
700/700; changed-branch coverage is 322/334.

Assisted-by: Claude Code
…ibaba#15933)

Preserve ordinary JVM startup while generating and selecting per-context AOT
initializers. Retain auth bean lifecycle and implicit form/serialization metadata,
and document reproducible Native validation and the embedded Derby limitation.

Assisted-by: Codex
KomachiSion and others added 3 commits October 22, 2026 20:22
…ng (alibaba#15934)

Build the selected Bootstrap application contexts in a dedicated AOT JVM,
include runtime SPI plugins in generation and Native compilation, and package
a platform-specific executable with its structural manifest. Keep the default
JVM build and launcher unchanged and reject incomplete Native releases.

Add build-helper unit tests and JDK-based build integration coverage for
context selection, external plugins, incremental output, argument files,
packaging guards, and launcher behavior.

Assisted-by: Codex
…rch (alibaba#15920)

* Extract shared HTTP transport for AI model calls

Reuse authenticated JSON transport in offline index enhancement and provide sanitized HTTP failure metadata for model adapters.

Assisted-by: Claude Code

* Add extensible Jev relevance evaluation with bounded batches

Add a provider contract and Jev adapter with startup validation, input limits, bounded concurrent batches, one request deadline and whole-request fallback. Document configuration and filtering semantics, and test protocol validation, cancellation and node capacity.

Assisted-by: Claude Code

* Integrate relevance filtering into ARD search pagination

Apply optional filtering after eligibility checks and before pagination, preserve base ordering and scores, bind enhanced cursors to query and configuration, and expose assessment status in an HTTP header. Add Search Core and adaptor tests, update both adaptor specifications and register API IT coverage.

Assisted-by: Claude Code

* Set default ARD relevance threshold to 0.50

Use 0.50 when the relevance threshold is omitted, preserve explicit overrides, and align configuration examples, specifications, and tests.

Assisted-by: Claude Code

* Fix relevance filter dependency in search application context test

Register the relevance filter mock in the manually assembled Spring context and verify setter injection. This restores the constructor-selection regression test after adding the required filter dependency.

Assisted-by: Claude Code

* Sync bootstrap Jev configuration with distribution defaults

Mirror the optional ARD relevance filtering settings in the bootstrap configuration so packaged defaults satisfy the configuration consistency test.

Assisted-by: Claude Code
…aba#15916)

* For alibaba#15899, target console UI to Chromium 90

* For alibaba#15899, polyfill Object.hasOwn and keep multi-browser CSS targets

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

* For alibaba#15899, polyfill Object.hasOwn in Monaco workers

Assisted-by: Codex

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown

Thanks for your this PR. 🙏
Please check again for your PR changes whether contains any usage/api/configuration change such as Add new API , Add new configuration, Change default value of configuration.
If so, please add or update documents(markdown type) in docs/next/ for repository nacos-group/nacos-group.github.io


感谢您提交的PR。 🙏
请再次查看您的PR内容,确认是否包含任何使用方式/API/配置参数的变更,如:新增API、新增配置参数、修改默认配置等操作。
如果是,请确保在提交之前,在仓库nacos-group/nacos-group.github.io中的docs/next/目录下添加或更新文档(markdown格式)。

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.