RFR: 8358496: Concurrent reading from Socket with timeout executes sequentially [v2]
Alan Bateman
alanb at openjdk.org
Tue Jun 3 16:10:38 UTC 2025
> If several threads attempt to read from a Socket's input stream at the same time then all but the winner will block trying to acquire the read lock. This is okay for untimed-reads but surprising for timed-reads as the timeout is only effective after acquiring the lock. The SocketImpl is changed so that the timeout applies to the total time waiting to acquire and read.
>
> A new test is added to the existing java/net/Socket/Timeouts test. It is migrated from TestNG to a JUnit test as a drive-by change - it's mostly mechanical and the changes kept as minimal as possible.
Alan Bateman has updated the pull request incrementally with one additional commit since the last revision:
Make test comment cleaner
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/25614/files
- new: https://git.openjdk.org/jdk/pull/25614/files/80fe13b1..3dc870ed
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=25614&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=25614&range=00-01
Stats: 3 lines in 1 file changed: 1 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/25614.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/25614/head:pull/25614
PR: https://git.openjdk.org/jdk/pull/25614
More information about the net-dev
mailing list