[#1265] Avoid monitor request errors during local connection shutdown (#1266)
Fixes #1265
A monitor request can retain an RS handler whose session the reader has
already closed. The real send then fails on the closed socket, and
monitor recomputation previously logged ERROR 108 even during local
cleanup.
`ReplicationDomainMonitor` now reports ERROR 108 only when the handler
is not shutting down and local session close has not begun. Both flags
are checked after the failed send. Exception tracing is unconditional,
including when ERROR 108 is suppressed. Failures on otherwise live
handlers retain the existing diagnostic. Best-effort recomputation
continues to other peers. Only requests whose send returns without
throwing register an expected response. A request dropped during
concurrent session close may still be awaited and produce WARN 106; this
existing pending-response behavior is unchanged. Convergence error
filters remain unchanged.
Nine regression cases use real TLS sessions and the real handler send
path, with domain construction and handler lifecycle state controlled by
the fixture. They cover all four close/shutdown combinations, local
close after handler selection, shutdown after selection, successful
delivery, continued delivery to a healthy peer after another send fails,
and exception tracing when ERROR 108 is suppressed. Failed-send cases
require an actual IOException and no missing-response warning; requests
delivered to a deliberately silent peer must produce that warning. The
trace case captures the real send's IOException through a method-scoped
debug publisher, removed in finally without replacing existing
publishers. The concurrent-close case releases the send after close()
completes; it does not cover a request dropped while close() is still in
progress.
## Validation
On JDK 21, based on master `cdc884c34f`:
- Without the trace call, only `suppressedRequestFailureIsStillTraced`
fails among the nine request cases: the real send throws
`SocketException: Socket closed`, but the captured trace is empty.
- Maven reactor `-Pprecommit verify`, including Javadoc, passes all 56
selected tests with no failures, errors or skips: 9 request, 3
monitor-state, 8 reply, 8 heartbeat, 8 reader, 4 writer, 6 session and
10 publisher-drain cases.
- Moving the trace call inside the ERROR guard fails only the new trace
case (1 failure out of 9). The same direct TestNG runner passes 9/9
against the unmodified build. The mutant was compiled outside reactor
build outputs.
- `git diff --check` passes. Independent local read-only review found no
issues.
Docker convergence and the full repository test suite were not run
locally.
```sh
mvn -o -Pprecommit verify -pl opendj-server-legacy -am \
-Dit.test=ReplicationDomainMonitorRequestTest,ReplicationDomainMonitorTest,ReplicationServerDomainMonitorTest,ReplicationServerDomainHeartbeatTest,ServerReaderDisconnectTest,ServerWriterDisconnectTest,SessionTest,SessionPublisherDrainTest \
-Dfailsafe.failIfNoSpecifiedTests=false \
-Dtest=NoTestsSelected -Dsurefire.failIfNoSpecifiedTests=false
```