mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Valery Kharseko
14 hours ago bcd00254cd86748aca2bb81cf4bb30267f1bc2a6
refs
author Valery Kharseko <vharseko@3a-systems.ru>
Tuesday, November 3, 2026 09:59 +0100
committer GitHub <noreply@github.com>
Tuesday, November 3, 2026 09:59 +0100
commitbcd00254cd86748aca2bb81cf4bb30267f1bc2a6
tree 1cc3525e2ba7fdeec0120e8c2901a6fff6326798 tree | zip | gz
parent c6650aedac5c1ade8aee9e7a76eb0dd100a3e179 view | diff
[#1262] Avoid monitor reply errors during local connection shutdown (#1263)

Fixes #1262

A pending RS monitor reply can retain a handler whose session the reader
has already closed. Its real send then fails on the closed socket, and
`sendPendingMonitorMsgs()` previously reported ERROR 66 even during
local cleanup.

The RS send-failure catch now reports ERROR 66 only when the handler is
not shutting down and local session close has not begun. Both flags are
read after the failed send. Exception tracing remains unconditional, and
failures on otherwise live sessions retain the destination-specific
error. The requester/reader still owns failure detection and cleanup;
this path does not call `stopServer()`. Convergence error filters remain
unchanged.

Eight regression cases use real TLS sessions and the real handler send
path, with domain construction and lifecycle operations mocked. They
cover all four close/shutdown combinations, close after handler
selection, shutdown after selection, successful delivery, and retained
exception tracing. Failed-send cases require an actual IOException and
verify that no handler stop was requested.

Validation on JDK 21, based on master `c6650aedac`:

- Before the fix, six of the eight new cases fail on an unexpected ERROR
66; the other 38 selected tests pass.
- Maven reactor `-Pprecommit verify`, including Javadoc, passes all 44
selected tests with no failures, errors or skips: 8 monitor, 8
heartbeat, 8 reader, 4 writer, 6 session and 10 publisher-drain cases.
- All seven isolated mutations are detected: omitting either guard flag,
caching either flag before the send, guarding exception tracing, adding
`stopServer()`, and logging the sender instead of the destination.
Mutation classes were compiled outside reactor outputs; the final
reactor run used the unmodified fix.
- `git diff --check` passes; independent local review found no issues.

Docker convergence was not run locally.

```sh
mvn -o -Pprecommit verify -pl opendj-server-legacy -am \
-Dit.test=ReplicationServerDomainMonitorTest,ReplicationServerDomainHeartbeatTest,ServerReaderDisconnectTest,ServerWriterDisconnectTest,SessionTest,SessionPublisherDrainTest \
-Dfailsafe.failIfNoSpecifiedTests=false \
-Dtest=NoTestsSelected -Dsurefire.failIfNoSpecifiedTests=false
```
1 files modified
1 files added
400 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/replication/server/ReplicationServerDomain.java 11 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/replication/server/ReplicationServerDomainMonitorTest.java 389 ●●●●● diff | view | raw | blame | history