mroeppis opened a new pull request, #13791: URL: https://github.com/apache/ignite/pull/13791
## Description Communication connection establishment can leave threads waiting indefinitely when an operation fails without completing its associated future or when a timeout does not cover the entire operation. Threads waiting for an ongoing connection attempt can be affected as well, potentially leading to communication pool starvation. This PR addresses these issues to ensure that failed connection attempts are reported, connection establishment is time-bounded, and waiting threads are released when their reservation expires or the communication SPI stops. ### Changes - **NIO session creation:** Ensure that failures during channel registration complete the associated session creation future exceptionally. This prevents callers from waiting indefinitely when a session can no longer be established. - **Connection establishment timeout:** Apply a single deadline to the complete connection establishment process. This prevents individual stages of an attempt from extending its duration beyond the configured connection establishment timeout. - **Connection client reservation:** Bound waits for an ongoing connection attempt by the remaining reservation timeout. This prevents threads from waiting indefinitely for a connection future that is never completed. - **Communication SPI shutdown:** Complete pending connection futures when the communication SPI stops, ensuring that waiting threads are released. - **Concurrent client creation and shutdown:** Prevent a newly created client from being returned or published if shutdown has already completed the corresponding connection future. ### Tests Regression tests cover failed NIO channel registration, connection establishment deadlines, simultaneous connection recovery, bounded client reservation waits, shutdown handling, concurrent client creation and shutdown, and inverse connection budget handling. Relevant scenarios are also covered with SSL. ### Scope The connection establishment deadline applies to each individual connection attempt. The reservation timeout bounds threads waiting for an ongoing connection attempt; it does not impose a single overall deadline on the creator's connection process across multiple addresses. The synchronous connection requestor call is also outside the reservation budget. Recovery after an unexpected NIO worker termination while the Ignite node remains operational is not covered by this change. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
