steveloughran commented on PR #4766:
URL: https://github.com/apache/hadoop/pull/4766#issuecomment-1221019682

   HADOOP-18410. copy fields to variables before use in a lambda expression
   
   the key cause is that even though the fields passed in to drain() were
   converted to references through the methods, in the lambda expression
   passed in to submit, they are direct references
   ```
   operation = client.submit(
    () -> drain(uri, streamStatistics, 
          false, reason, remaining, 
          object, wrappedStream));  /* here */
   ```
   the fields are only read during the async execution, not during the submit 
phase.
   
   the next step the code does is reset those fields; the async work is
   failing with an NPE which isn't being noted.
   
   Adding the join() after submit works *because this was inserted before
   the fields were set to null...so no NPE being silently raised.
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to