Integrated: 8345176: Add tests to verify java.net.Socket constructors close the socket on failure

Volkan Yazıcı duke at openjdk.org
Mon Dec 2 12:59:45 UTC 2024


On Thu, 28 Nov 2024 14:30:02 GMT, Volkan Yazıcı <duke at openjdk.org> wrote:

> [8343791](https://bugs.openjdk.org/browse/JDK-8343791) (addressed by #22160) stresses that `Socket::connect()` failures should be handled such that the resultant state of the `Socket` and its underlying `SocketImpl` should match. In a similar fashion, `Socket::new` (which is using `bind()` and `connect()` under the hood) failures should not leave behind an open `SocketImpl` either. This change set, addressing [8345176](https://bugs.openjdk.org/browse/JDK-8345176), adds `CtorFailTest` verifying this behavior.

This pull request has now been integrated.

Changeset: e3b679a2
Author:    Volkan Yazıcı <volkan.yazici at oracle.com>
Committer: Daniel Fuchs <dfuchs at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/e3b679a2f631bb2c3c9ba3014d9b56c73eef95d5
Stats:     220 lines in 1 file changed: 220 ins; 0 del; 0 mod

8345176: Add tests to verify java.net.Socket constructors close the socket on failure

Reviewed-by: dfuchs

-------------

PR: https://git.openjdk.org/jdk/pull/22439


More information about the net-dev mailing list