Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-6381

Unnecessary synchronized object in BucketingSink

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0
    • None

    Description

      It seems that currently there are two places should not employ the synchronized to describe pendingFilesPerCheckpoint, as it is only restored state object for checkpoint and no sharing of the data-structure between different threads, as follows.

       private void handleRestoredRollingSinkState(RollingSink.BucketState restoredState) {
           ...
          synchronized (restoredState.pendingFilesPerCheckpoint) {
      			restoredState.pendingFilesPerCheckpoint.clear();
      		}
           ...
      }

      and

      private void handleRestoredBucketState(State<T> restoredState) {       
          ...
          synchronized (bucketState.pendingFilesPerCheckpoint) {
      	     	        bucketState.pendingFilesPerCheckpoint.clear();
      		}
       } 

      Hi, kkl0u. Is there any other stuff shoud add here ? Would you mind have a more thorough look in this class ?

      Attachments

        Issue Links

          Activity

            People

              mingleizhang zhangminglei
              mingleizhang zhangminglei
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: