Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-3875

Unnecessary synchronization and conditionals in MiniAccumuloClusterControl

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.0
    • Fix Version/s: 1.6.3, 1.7.1, 1.8.0
    • Component/s: mini
    • Labels:

      Description

      MiniAccumuloClusterControl has a few areas that could be cleaned up

      The following null check on tabletServerProcesses is unnecessary.

            case TABLET_SERVER:
              if (tabletServerProcesses != null) {
                synchronized (tabletServerProcesses) {
                  try {
                    for (Process tserver : tabletServerProcesses) {
                      try {
                        cluster.stopProcessWithTimeout(tserver, 30, TimeUnit.SECONDS);
                      } catch (ExecutionException e) {
                        log.warn("TabletServer did not fully stop after 30 seconds", e);
                      } catch (TimeoutException e) {
                        log.warn("TabletServer did not fully stop after 30 seconds", e);
                      } catch (InterruptedException e) {
                        Thread.currentThread().interrupt();
                      }
                    }
                  } finally {
                    tabletServerProcesses.clear();
                  }
                }
              }
              break;
      

      tabletServerProcesses should probably be final and likely does not need to be a synchronizedList because the data structure is used for synchronization before each access anyways.

        List<Process> tabletServerProcesses = Collections.synchronizedList(new ArrayList<Process>());
      

        Attachments

          Activity

            People

            • Assignee:
              elserj Josh Elser
              Reporter:
              elserj Josh Elser
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

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