Uploaded image for project: 'Apache Tez'
  1. Apache Tez
  2. TEZ-4350

Remove synchronized from DAGAppMaster.serviceInit, serviceStart, serviceStop

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.9.3, 0.10.2
    • None
    • None

    Description

      according to AbstractService.serviceInit javadoc

         * This method will only ever be called once during the lifecycle of
         * a specific service instance.
         *
         * Implementations do not need to be synchronized as the logic
         * in {@link #init(Configuration)} prevents re-entrancy.
      

      moreover, it generates findbugs alerts for every field that is accessed somewhere else in DAGAppMaster in an unsynchronized fashion:

      Code	Warning
      IS	Inconsistent synchronization of org.apache.tez.dag.app.DAGAppMaster.webUIService; locked 57% of time
      Bug type IS2_INCONSISTENT_SYNC (click for details)
      In class org.apache.tez.dag.app.DAGAppMaster
      Field org.apache.tez.dag.app.DAGAppMaster.webUIService
      Synchronized 57% of the time
      Unsynchronized access at DAGAppMaster.java:[line 2623]
      Unsynchronized access at DAGAppMaster.java:[line 2623]
      Synchronized access at DAGAppMaster.java:[line 568]
      Synchronized access at DAGAppMaster.java:[line 569]
      Synchronized access at DAGAppMaster.java:[line 578]
      Synchronized access at DAGAppMaster.java:[line 656]
      

      I cannot see any value now in having it synchronized (most probably this wasn't the case 8 years ago at the time of TEZ-537)

      UPDATE: double-checked, AbstractService lifecycle methods are protected with a lock since YARN-530

      Attachments

        Issue Links

          Activity

            People

              abstractdog László Bodor
              abstractdog László Bodor
              Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 2h 20m
                  2h 20m