RFR: 8299338: AssertionError in ResponseSubscribers$HttpResponseInputStream::onSubscribe [v2]

Daniel Fuchs dfuchs at openjdk.org
Tue Feb 21 16:28:52 UTC 2023


> This fix revisits an assertion that has been observed failing in ResponseSubscribers.HttpResponseInputStream.
> 
> The HttpResponseInputStream has the logic to wait until a buffer has been taken out of the queue before requesting a new one. Therefore there should at most be one byte buffer in the queue, except in the case of error (or asychronous close), where a LAST_LIST sentinel is inserted in the queue to unblock the consumer of the input stream, which might be blocked in queue.take().
> 
> The  HttpResponseInputStream thus asserts, when processing a subscription, that the remaining capacity of the queue should be greater than 1 (unless already closed), to ensure that there will be room for the LAST_LIST sentinel. However, in case of asynchronous shutdown of the executor, it's possible that the subscriber will be marked failed and the LAST_LIST sentinel inserted into the queue before/at the same time that the subscription is processed.
> 
> This fix proposes to relax the assertion to only fire if closed == false and failed == null and capacity <= 1 when processing the subscription

Daniel Fuchs has updated the pull request incrementally with one additional commit since the last revision:

  Call tryRegister() before markSubscribed()

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/12677/files
  - new: https://git.openjdk.org/jdk/pull/12677/files/cbb55deb..28860b0c

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=12677&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=12677&range=00-01

  Stats: 46 lines in 5 files changed: 17 ins; 16 del; 13 mod
  Patch: https://git.openjdk.org/jdk/pull/12677.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/12677/head:pull/12677

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


More information about the net-dev mailing list