Uploaded image for project: 'Apache Storm'
  1. Apache Storm
  2. STORM-2234

heartBeatExecutorService in shellSpout don't work well with deactivate

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.x, 0.10.3
    • 2.0.0, 1.1.0, 1.0.3
    • storm-core
    • Irrelevant - all

    Description

      When using the activate and deactivate of a shellSpout (using the client):
      1 .First we deactivate -which calls :

      heartBeatExecutorService.shutdownNow();


      2. Then we actiavate which calls:

      heartBeatExecutorService.scheduleAtFixedRate(new SpoutHeartbeatTimerTask(this), 1, 1, TimeUnit.SECONDS);


      3.This results in an

      RejectedExecutionException

      as we already shutdown the heartBeatExecutorService.
      4.Simple test to prove this:

          
      private class TestTimerTask extends TimerTask {
      
      
              @Override
              public void run() {
                  System.out.println("Im running now");
              }
          }
      
          @Test(expectedExceptions = RejectedExecutionException.class)
          public void heartBeatShutdownTest() {
              ScheduledExecutorService heartBeatExecutorService = MoreExecutors.getExitingScheduledExecutorService(new ScheduledThreadPoolExecutor(1));
              heartBeatExecutorService.scheduleAtFixedRate(new TestTimerTask(), 1, 1, TimeUnit.SECONDS);
              heartBeatExecutorService.shutdownNow();
              heartBeatExecutorService.scheduleAtFixedRate(new TestTimerTask(), 1, 1, TimeUnit.SECONDS);
          }

      5.Already created a fix and opening a PR with it: https://github.com/apache/storm/pull/1813

      Attachments

        Issue Links

          Activity

            People

              itielshw itiel
              itielshw itiel
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0h
                  0h
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h