[hibernate-commits] [hibernate/hibernate-search] 5e39f3: HSEARCH-2854 Avoid 0-length writes in GsonHttpEnti...

GitHub noreply at github.com
Tue Aug 22 11:56:11 EDT 2017


  Branch: refs/heads/master
  Home:   https://github.com/hibernate/hibernate-search
  Commit: 5e39f3e67aa9deaab3d497b23314333f9dc79b1d
      https://github.com/hibernate/hibernate-search/commit/5e39f3e67aa9deaab3d497b23314333f9dc79b1d
  Author: Yoann Rodière <yoann at hibernate.org>
  Date:   2017-08-22 (Tue, 22 Aug 2017)

  Changed paths:
    M elasticsearch/src/main/java/org/hibernate/search/elasticsearch/util/impl/GsonHttpEntity.java

  Log Message:
  -----------
  HSEARCH-2854 Avoid 0-length writes in GsonHttpEntity

When content-length is defined, the encoder is a LengthDelimitedEncoder,
and even a 0-length write will trigger an exception when the content
length has been reached.

It turns out the issue is very unlikely to occur right now, because it
requires that the content-length be defined (which currently only happens
if the content length is less than 1024 bytes) *and* that the flow
control push back (which is apparently unlikely to happen before the
first 1024 bytes have been written).
But a few changes are coming, mainly HSEARCH-2849, which will improve
content-length detection and thus make the issue more likely to occur.


  Commit: e13fed303ffd7b7b585ef543f917e7e8786b6876
      https://github.com/hibernate/hibernate-search/commit/e13fed303ffd7b7b585ef543f917e7e8786b6876
  Author: Yoann Rodière <yoann at hibernate.org>
  Date:   2017-08-22 (Tue, 22 Aug 2017)

  Changed paths:
    M elasticsearch/src/test/java/org/hibernate/search/elasticsearch/test/GsonStreamedEncodingTest.java

  Log Message:
  -----------
  HSEARCH-2854 Add non-regression tests for 0-length writes in GsonHttpEntity


Compare: https://github.com/hibernate/hibernate-search/compare/5453eecab735...e13fed303ffd


More information about the hibernate-commits mailing list