[ 
https://issues.apache.org/jira/browse/ORC-310?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16397390#comment-16397390
 ] 

Sergey Shelukhin edited comment on ORC-310 at 3/13/18 6:06 PM:
---------------------------------------------------------------

This now addresses two issues.
First of all, there's issue with clone; namely codec reference gets shallow 
copied and then cleanup returns the codec to the pool twice. This affects every 
codec.
Then, and this happened in both issues I think - when we were not calling reset 
and here - an invalid codec can be added to the pool on error (doesn't matter 
which error).
So, the code is changed to handle reset failure and discard the codec, and also 
to allow the user to report an error (this is done for convenience to avoid 
every piece of code using the codec having to do 
if-ok-then-return-else-try-close-catch-log-error dance.


was (Author: sershe):
This now addresses two issues.
First of all, there's issue with clone env; namely codec reference gets shallow 
copied and then cleanup returns the codec to the pool twice.
Then, and this happened in both issues I think - when we were not calling reset 
and here - an invalid codec can be added to the pool on error (doesn't matter 
which error).
So, the code is changed to handle reset failure and discard the codec, and also 
to allow the user to report an error (this is done for convenience to avoid 
every piece of code using the codec having to do 
if-ok-then-return-else-try-close-catch-log-error dance.

> better error handling and lifecycle management for codecs
> ---------------------------------------------------------
>
>                 Key: ORC-310
>                 URL: https://issues.apache.org/jira/browse/ORC-310
>             Project: ORC
>          Issue Type: Bug
>            Reporter: Sergey Shelukhin
>            Assignee: Sergey Shelukhin
>            Priority: Major
>
> When there's a failure potentially involving the codec, the codec object may 
> be left in bad state and should not be reused (esp. given that Hadoop codecs 
> are brittle w.r.t. how they maintain state).
> The codecs can be closed on error instead.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to