Uploaded image for project: 'Flume'
  1. Flume
  2. FLUME-1258

TailDirSource might get dead lock when delete file in dir.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Won't Fix
    • Affects Version/s: 0.9.3
    • Fix Version/s: 0.9.5
    • Component/s: Sinks+Sources
    • Labels:
      None

      Description

      when fileDelete fired ,DirWatcher it calls tail.removeCursor(c)
      DirWather:
      1,(sucess)get lock of tail --> synchronized public void removeCursor
      2,get lock of rmCursors--->synchronized (rmCursors)

      { rmCursors.add(cursor);}

      if at this time , TailThread has some rmCursors to handle
      TailThread:
      1,(sucess)get lock of rmCursors
      2,foreach rmCursors call c.flush()
      in c.flush(), it put event in SynchronousQueue,block until
      another thread(PumperThread) to poll it

      PumperThread:
      1,(success)poll from SynchronousQueue,
      2,try get lock of tail to updateEventProcessingStats,but it can beacuse
      DirWather get it!so the PumperThread block here.

      Because the PumperThread blocked , the SynchronousQueue didn't release it's capacity,then the TailThread 2 step blocked ,and the TailThread didn't release the lock of rmCursors ,and the DirWather 2 step blocked .

      it's a block chain.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              nice2mu Li Junjun
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: