Integrated: 8255583: Investigate creating a test to trigger the condition in KeepAliveStreamCleaner
Conor Cleary
ccleary at openjdk.java.net
Fri Dec 11 16:09:58 UTC 2020
On Mon, 7 Dec 2020 09:52:47 GMT, Conor Cleary <ccleary at openjdk.org> wrote:
> The KeepAliveStreamCleaner in sun.net.ww.http package had been previously seen to fail with an IllegalMonitorStateException. This failure was caused by the use of `wait()` in a non synchronized block. This failure was mitigated through use of `await()` instead as is shown below (code can be viewed on L119 in src/java.base/share/classes/sun/net/www/http/KeepAliveStreamCleaner.java).
>
> ...
> long timeout = TIMEOUT;
> while ((kace = poll()) == null) {
> waiter.await(timeout, TimeUnit.MILLISECONDS);
> ...
> While the code throwing the exception was fixed, a regression test was not made. So this patch adds a simple white-box test which calls the KeepAliveStreamCleaner's run method. `waiter.wait()` should always fail if not used in a synchronized block or method, so the test verifies that it is not used.
This pull request has now been integrated.
Changeset: f9c9bf03
Author: Conor Cleary <ccleary at openjdk.org>
Committer: Daniel Fuchs <dfuchs at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/f9c9bf03
Stats: 70 lines in 2 files changed: 70 ins; 0 del; 0 mod
8255583: Investigate creating a test to trigger the condition in KeepAliveStreamCleaner
Reviewed-by: dfuchs, chegar, michaelm
-------------
PR: https://git.openjdk.java.net/jdk/pull/1659
More information about the net-dev
mailing list