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

ASF GitHub Bot commented on DRILL-4676:
---------------------------------------

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

    https://github.com/apache/drill/pull/503#discussion_r63573505
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/Foreman.java ---
    @@ -1206,42 +1210,18 @@ public void interrupted(final InterruptedException 
e) {
       }
     
       /**
    -   * Provides gated access to state transitions.
    -   *
    -   * <p>The StateListener waits on a latch before delivery state 
transitions to the Foreman. The
    -   * latch will be tripped when the Foreman is sufficiently set up that it 
can receive and process
    -   * external events from other threads.
    -   */
    -  public class StateListener {
    -    /**
    -     * Move the Foreman to the specified new state.
    -     *
    -     * @param newState the state to move to
    -     * @param ex if moving to a failure state, the exception that led to 
the failure; used for reporting
    -     *   to the user
    -     */
    -    public void moveToState(final QueryState newState, final Exception ex) 
{
    -      acceptExternalEvents.awaitUninterruptibly();
    -
    -      Foreman.this.moveToState(newState, ex);
    -    }
    -  }
    -
    -  /**
        * Listens for the status of the RPC response sent to the user for the 
query.
        */
       private class ResponseSendListener extends BaseRpcOutcomeListener<Ack> {
         @Override
         public void failed(final RpcException ex) {
           logger.info("Failure while trying communicate query result to 
initiating client. " +
                   "This would happen if a client is disconnected before 
response notice can be sent.", ex);
    -      stateListener.moveToState(QueryState.FAILED, ex);
    --- End diff --
    
    Please add a note about this in the commit message.


> Foreman.moveToState can block forever if called by the foreman thread while 
> the query is still being setup
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: DRILL-4676
>                 URL: https://issues.apache.org/jira/browse/DRILL-4676
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Flow
>    Affects Versions: 1.6.0
>            Reporter: Deneche A. Hakim
>            Assignee: Sudheesh Katkam
>             Fix For: 1.7.0
>
>
> When the query is being setup, foreman has a special CountDownLatch that 
> blocks rpc threads from delivering external events, this latch is unblocked 
> at the end of the query setup.
> In some cases though, when the foreman is submitting remote fragments, a 
> failure in RpcBus.send() causes an exception to be thrown that is reported to 
> Foreman.FragmentSubmitListener and blocks in the CountDownLatch. This causes 
> the foreman thread to block forever, and can rpc threads to be blocked too.
> This seems to happen more frequently at a high concurrency load, and also can 
> prevent clients from connecting to the Drillbits.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to