> On Feb. 14, 2016, 9:37 p.m., Stephan Erb wrote:
> > src/main/java/org/apache/aurora/codec/ThriftBinaryCodec.java, line 164
> > <https://reviews.apache.org/r/43567/diff/1/?file=1241353#file1241353line164>
> >
> >     Note: this `close` cannot be moved to `finally` and cannot be replaced 
> > by a `flush`. It is mandatory at this position.
> 
> Bill Farner wrote:
>     I presume this is because closing has a flush effect that renders 
> `outBytes` complete?  A one-line comment to that effect would go a long way.
>     
>     However, can you additionally do the `close()` in a finally without 
> causing harm? (and omit from the `catch` branch)

Good call. Done.


- Stephan


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43567/#review119187
-----------------------------------------------------------


On Feb. 14, 2016, 10:46 p.m., Stephan Erb wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43567/
> -----------------------------------------------------------
> 
> (Updated Feb. 14, 2016, 10:46 p.m.)
> 
> 
> Review request for Aurora, John Sirois and Zameer Manji.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> Closing Deflater/Inflater streams explicitly frees their native memory 
> instantly. Otherwise, the memory will only be freed once the object finalizer 
> runs.
> 
> I got the idea from this article 
> http://www.evanjones.ca/java-native-leak-bug.html. Unfortunately, we cannot 
> use the Java close-with-resource feature, as `TTransport` in our current 
> Thrift version does not implement `Closable`.
> 
> 
> Diffs
> -----
> 
>   src/main/java/org/apache/aurora/codec/ThriftBinaryCodec.java 
> 6b65c0f6cb60b98ff352c4c5d5fed38d52b4b062 
> 
> Diff: https://reviews.apache.org/r/43567/diff/
> 
> 
> Testing
> -------
> 
> ./gradlew -Pq build
> 
> 
> Thanks,
> 
> Stephan Erb
> 
>

Reply via email to