Github user parthchandra commented on a diff in the pull request:

    https://github.com/apache/drill/pull/919#discussion_r136155556
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/Foreman.java ---
    @@ -1073,26 +1070,22 @@ public QueryId getQueryId() {
        */
       private void setupRootFragment(final PlanFragment rootFragment, final 
FragmentRoot rootOperator)
           throws ExecutionSetupException {
    -    @SuppressWarnings("resource")
         final FragmentContext rootContext = new 
FragmentContext(drillbitContext, rootFragment, queryContext,
             initiatingClient, 
drillbitContext.getFunctionImplementationRegistry());
    -    @SuppressWarnings("resource")
    -    final IncomingBuffers buffers = new IncomingBuffers(rootFragment, 
rootContext);
    -    rootContext.setBuffers(buffers);
    -
    -    queryManager.addFragmentStatusTracker(rootFragment, true);
    -
         final ControlTunnel tunnel = 
drillbitContext.getController().getTunnel(queryContext.getCurrentEndpoint());
    +    final FragmentStatusReporter statusReporter = new 
FragmentStatusReporter(rootContext, tunnel);
         final FragmentExecutor rootRunner = new FragmentExecutor(rootContext, 
rootFragment,
    -        new FragmentStatusReporter(rootContext, tunnel),
    -        rootOperator);
    -    final RootFragmentManager fragmentManager = new 
RootFragmentManager(rootFragment.getHandle(), buffers, rootRunner);
    +        statusReporter, rootOperator);
     
    -    if (buffers.isDone()) {
    +    queryManager.addFragmentStatusTracker(rootFragment, true);
    +
    +    // FragmentManager is setting buffer for FragmentContext
    +    if (rootContext.isBuffersDone()) {
    --- End diff --
    
    Yes but from the looks of it the fragment manager hasn't been created yet. 
In fact it seems it is created in the else part of the condition you're 
checking.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to