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

TailDirSource might get dead lock when delete file in dir.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Won't Fix
    • 0.9.3
    • 0.9.5
    • Sinks+Sources
    • 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

            Unassigned Unassigned
            nice2mu Li Junjun
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: