You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flume.apache.org by "Jonathan Hsieh (JIRA)" <ji...@apache.org> on 2011/08/17 23:59:27 UTC

[jira] [Commented] (FLUME-745) Race condition in RollSink.

    [ https://issues.apache.org/jira/browse/FLUME-745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13086625#comment-13086625 ] 

Jonathan Hsieh commented on FLUME-745:
--------------------------------------

  @Test
  public void testRotateRaciness() throws IOException, InterruptedException {

    CounterSink cnt = new CounterSink("count");
    int millis = 10; // rotate the agent wal entries every 10 millis.
    int events = 10000;
    int iters = 10;
    int expected = events * iters;
    MemorySinkSource mem = MemorySinkSource.cannedData("blah", events);

    NaiveFileWALDeco wal = (NaiveFileWALDeco) NaiveFileWALDeco
        .builderEndToEndDir().create(LogicalNodeContext.testingContext(),
            millis);
    wal.setSink(cnt);
    try {
      wal.open();
      for (int i = 0; i < iters; i++) {
        EventUtil.dumpAll(mem, wal);
        mem.open(); // goes back to beginning for another loop
      }
    } finally {
      wal.close();
      Log.info("Counted " + cnt.getCount() + " of " + expected + " expected");
    }
    assertEquals(cnt.getCount(), expected);
  }

In testing, race causes an exit/exception after 20k-30k rotations.  I'm pretty convinced the problem is in the roller.

> Race condition in RollSink.
> ---------------------------
>
>                 Key: FLUME-745
>                 URL: https://issues.apache.org/jira/browse/FLUME-745
>             Project: Flume
>          Issue Type: Bug
>    Affects Versions: v0.9.5
>            Reporter: Jonathan Hsieh
>
> There is a race condition present when rotating sinks in a roller.  It is fairly rare but can cause a agent or collector to hang.  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira