korlov42 opened a new pull request, #2565:
URL: https://github.com/apache/ignite-3/pull/2565

   The race was caused by rewinding node from incorrect thread.
   
   The problematic sequence of event was as follow:
   1. main thread calls `hasNext` and waits on condition inside `RootNode`
   2. task executor thread starts scanning empty iterator, which renders in an 
immediate call to `Downstream#end` on the entire tree
   3. inside `SortAggregateNode#end` task executor calls to 
`downstream().end()` that notifies condition and releases main thread
   
   next points go concurrently
   
   4. task executor proceeds execution inside `SortAggregateNode#end` and 
nullifies `grp` field
   5. main thread rewinds the node and reinitialise `grp` with new group
   
   If main thread outruns task executor (p5 goes before p4), then `grp` will be 
incorrectly nullified, and root node will return empty result.
   
   Besides fix of the race, in this patch I replace invocation of deprecated 
`AggregateCall#create` with proper one, improve class-level javadoc and remove 
unnecessary method-level javadocs.
   
   ----------------------------------------------
   
   Thank you for submitting the pull request.
   
   To streamline the review process of the patch and ensure better code quality
   we ask both an author and a reviewer to verify the following:
   
   ### The Review Checklist
   - [ ] **Formal criteria:** TC status, codestyle, mandatory documentation. 
Also make sure to complete the following:  
   \- There is a single JIRA ticket related to the pull request.  
   \- The web-link to the pull request is attached to the JIRA ticket.  
   \- The JIRA ticket has the Patch Available state.  
   \- The description of the JIRA ticket explains WHAT was made, WHY and HOW.  
   \- The pull request title is treated as the final commit message. The 
following pattern must be used: IGNITE-XXXX Change summary where XXXX - number 
of JIRA issue.
   - [ ] **Design:** new code conforms with the design principles of the 
components it is added to.
   - [ ] **Patch quality:** patch cannot be split into smaller pieces, its size 
must be reasonable.
   - [ ] **Code quality:** code is clean and readable, necessary developer 
documentation is added if needed.
   - [ ] **Tests code quality:** test set covers positive/negative scenarios, 
happy/edge cases. Tests are effective in terms of execution time and resources.
   
   ### Notes
   - [Apache Ignite Coding 
Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Java+Code+Style+Guide)


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

Reply via email to