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

ASF GitHub Bot commented on HADOOP-18883:
-----------------------------------------

mukund-thakur commented on code in PR #6022:
URL: https://github.com/apache/hadoop/pull/6022#discussion_r1443395651


##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsHttpOperation.java:
##########
@@ -324,14 +328,26 @@ public void sendRequest(byte[] buffer, int offset, int 
length) throws IOExceptio
          */
         outputStream = getConnOutputStream();
       } catch (IOException e) {
-        /* If getOutputStream fails with an exception and expect header
-           is enabled, we return back without throwing an exception to
-           the caller. The caller is responsible for setting the correct 
status code.
-           If expect header is not enabled, we throw back the exception.
+        connectionDisconnectedOnError = true;

Review Comment:
   setting this field here and using in processResponse() means that we won't 
be processing response for any IOException. But isn't the intent to not process 
only in case of JDK error?
   So shouldn't this go inside the if 
(EXPECT_100_JDK_ERROR.equals(e.getMessage().......)  check? 





> Expect-100 JDK bug resolution: prevent multiple server calls
> ------------------------------------------------------------
>
>                 Key: HADOOP-18883
>                 URL: https://issues.apache.org/jira/browse/HADOOP-18883
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: fs/azure
>            Reporter: Pranav Saxena
>            Assignee: Pranav Saxena
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 3.4.0
>
>
> This is inline to JDK bug: [https://bugs.openjdk.org/browse/JDK-8314978].
>  
> With the current implementation of HttpURLConnection if server rejects the 
> “Expect 100-continue” then there will be ‘java.net.ProtocolException’ will be 
> thrown from 'expect100Continue()' method.
> After the exception thrown, If we call any other method on the same instance 
> (ex getHeaderField(), or getHeaderFields()). They will internally call 
> getOuputStream() which invokes writeRequests(), which make the actual server 
> call. 
> In the AbfsHttpOperation, after sendRequest() we call processResponse() 
> method from AbfsRestOperation. Even if the conn.getOutputStream() fails due 
> to expect-100 error, we consume the exception and let the code go ahead. So, 
> we can have getHeaderField() / getHeaderFields() / getHeaderFieldLong() which 
> will be triggered after getOutputStream is failed. These invocation will lead 
> to server calls.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to