[ 
https://issues.apache.org/jira/browse/HADOOP-17764?focusedWorklogId=613159&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-613159
 ]

ASF GitHub Bot logged work on HADOOP-17764:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 22/Jun/21 07:54
            Start Date: 22/Jun/21 07:54
    Worklog Time Spent: 10m 
      Work Description: majdyz commented on pull request #3109:
URL: https://github.com/apache/hadoop/pull/3109#issuecomment-864940353


   Hi @bogthe thanks for the feedback. 
   Sorry for getting back on this late, I'm running the test right now and will 
get back on this soon.
   
   And for the testing part:
   
   - Aside from the `.getObjectContent()` we also need to get the current 
implementation of the retry policy (the part where we have delay before the 
next retry) which attached in the `S3AReadOpContext`. I tried to keep the 
mocking minimum by only setting the behaviour of the inputStream, but to attach 
this we need to go from `InputStreamCallbacks` -> `S3Object` -> 
`S3ObjectInputStream` so two small mockings before that are needed. Let me know 
if there could be a better approach for this.
   - For the failure scenario, I provided these two tests where the current 
implementation breaks, let me know if there is any other scenario I should 
provide for the test


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 613159)
    Time Spent: 2h 50m  (was: 2h 40m)

> S3AInputStream read does not re-open the input stream on the second read 
> retry attempt
> --------------------------------------------------------------------------------------
>
>                 Key: HADOOP-17764
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17764
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs/s3
>    Affects Versions: 3.3.1
>            Reporter: Zamil Majdy
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 2h 50m
>  Remaining Estimate: 0h
>
> *Bug description:*
> The read method in S3AInputStream has this following behaviour when an 
> IOException happening during the read:
>  * {{reopen and read quickly}}: The client after failing in the first attempt 
> of {{read}}, will reopen the stream and try reading again without {{sleep}}.
>  * {{reopen and wait for fixed duration}}: The client after failing in the 
> attempt of {{read}}, will reopen the stream, sleep for 
> {{fs.s3a.retry.interval}} milliseconds (defaults to 500 ms), and then try 
> reading from the stream.
> While doing the {{reopen and read quickly}} process, the subsequent read will 
> be retried without reopening the input stream in case of the second failure 
> happened. This leads to some of the bytes read being skipped which results to 
> corrupt/less data than required. 
>  
> *Scenario to reproduce:*
>  * Execute S3AInputStream `read()` or `read(b, off, len)`.
>  * The read failed and throws `Connection Reset` exception after reading some 
> data.
>  * The InputStream is re-opened and another `read()` or `read(b, off, len)` 
> is executed
>  * The read failed for the second time and throws `Connection Reset` 
> exception after reading some data.
>  * The InputStream is not re-opened and another `read()` or `read(b, off, 
> len)` is executed after sleep
>  * The read succeed, but it skips the first few bytes that has already been 
> read on the second failure.
>  
> *Proposed fix:*
> [https://github.com/apache/hadoop/pull/3109]
> Added the test that reproduces the issue along with the fix



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to