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

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

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

    https://github.com/apache/drill/pull/1055#discussion_r154246723
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/testing/ExecutionControlsInjector.java
 ---
    @@ -81,8 +83,20 @@ public void injectPause(final ExecutionControls 
executionControls, final String
           executionControls.lookupPauseInjection(this, desc);
     
         if (pauseInjection != null) {
    -      logger.debug("Pausing at {}", desc);
    -      pauseInjection.pause();
    +      long pauseDuration = pauseInjection.getMsPause();
    +      if ( pauseDuration > 0L) {
    +        logger.debug("Pausing at {} for {} sec", desc, 
TimeUnit.MILLISECONDS.toSeconds(pauseDuration) );
    +      } else {
    +        logger.debug("Pausing at {}", desc);
    +      }
    +      try {
    +        pauseInjection.pause();
    +      } catch (InterruptedException e) {
    +        //Unpause if this is a timed pause, because an explicit unpause is 
not called
    +        if (pauseDuration > 0L) {
    --- End diff --
    
    Just following convention of 'unpausing' explicitly, rather than implicitly 
within the `pause()` for a limited-duration pause.


> Support injection of time-bound pauses in server
> ------------------------------------------------
>
>                 Key: DRILL-5973
>                 URL: https://issues.apache.org/jira/browse/DRILL-5973
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Tools, Build & Test
>    Affects Versions: 1.11.0
>            Reporter: Kunal Khatua
>            Assignee: Kunal Khatua
>             Fix For: 1.13.0
>
>
> While working on DRILL-3640 , when creating a unit test for a server-induced 
> timeout, the injecting a pause leaves the JUnit framework's DrillClient 
> without a handle to the query on the server. This is because we injected the 
> pause to occur before the server could send back a query ID, so the 
> DrillClient has no way to unpause the server.
> The workaround to support this unit test is to allow for injecting pauses 
> with a defined time-bound, after which the server would resume.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to