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

SyslogUtils fails when system locale is not English

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.0.1, 1.6.0
    • Fix Version/s: 1.6.0
    • Component/s: Sinks+Sources
    • Labels:

      Description

      SyslogUtils tests will fail if system locale is not English:

      TestHeader9(org.apache.flume.source.TestSyslogUtils) Time elapsed: 4 sec <<< ERROR!
      java.text.ParseException: Unparseable date: "2014Apr 11 13:14:04"
      at java.text.DateFormat.parse(DateFormat.java:357)
      at org.apache.flume.source.TestSyslogUtils.checkHeader(TestSyslogUtils.java:188)
      at org.apache.flume.source.TestSyslogUtils.checkHeader(TestSyslogUtils.java:202)
      at org.apache.flume.source.TestSyslogUtils.TestHeader9(TestSyslogUtils.java:138)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
      at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
      at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
      at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
      at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
      at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
      at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
      at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

      TestHeader10(org.apache.flume.source.TestSyslogUtils) Time elapsed: 2 sec <<< ERROR!
      java.text.ParseException: Unparseable date: "2014Apr 1 13:14:04"
      at java.text.DateFormat.parse(DateFormat.java:357)
      at org.apache.flume.source.TestSyslogUtils.checkHeader(TestSyslogUtils.java:188)
      at org.apache.flume.source.TestSyslogUtils.checkHeader(TestSyslogUtils.java:202)
      at org.apache.flume.source.TestSyslogUtils.TestHeader10(TestSyslogUtils.java:150)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
      at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
      at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
      at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
      at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
      at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
      at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
      at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

      TestRfc3164HeaderApacheLogWithNulls(org.apache.flume.source.TestSyslogUtils) Time elapsed: 2 sec <<< ERROR!
      java.text.ParseException: Unparseable date: "2014Apr 1 13:14:04"
      at java.text.DateFormat.parse(DateFormat.java:357)
      at org.apache.flume.source.TestSyslogUtils.checkHeader(TestSyslogUtils.java:188)
      at org.apache.flume.source.TestSyslogUtils.checkHeader(TestSyslogUtils.java:202)
      at org.apache.flume.source.TestSyslogUtils.TestRfc3164HeaderApacheLogWithNulls(TestSyslogUtils.java:161)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
      at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
      at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
      at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
      at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
      at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
      at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
      at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

        Activity

        Hide
        smolav Santiago M. Mola added a comment -

        This fixes the issue by forcing English locale on date parsing inside SyslogUtils.

        Show
        smolav Santiago M. Mola added a comment - This fixes the issue by forcing English locale on date parsing inside SyslogUtils.
        Hide
        hshreedharan Hari Shreedharan added a comment -

        Running tests now. This looks good, will commit if tests pass.

        Show
        hshreedharan Hari Shreedharan added a comment - Running tests now. This looks good, will commit if tests pass.
        Hide
        hshreedharan Hari Shreedharan added a comment -

        +1.

        Show
        hshreedharan Hari Shreedharan added a comment - +1.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 72b54c9909290fa5b98123b4b0c1332a425c5c64 in flume's branch refs/heads/trunk from Hari Shreedharan
        [ https://git-wip-us.apache.org/repos/asf?p=flume.git;h=72b54c9 ]

        FLUME-2472. SyslogUtils fails when system locale is not English

        (Santiago M. Mola via Hari)

        Show
        jira-bot ASF subversion and git services added a comment - Commit 72b54c9909290fa5b98123b4b0c1332a425c5c64 in flume's branch refs/heads/trunk from Hari Shreedharan [ https://git-wip-us.apache.org/repos/asf?p=flume.git;h=72b54c9 ] FLUME-2472 . SyslogUtils fails when system locale is not English (Santiago M. Mola via Hari)
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit e670cba3f7b4e58b6a4756829ec25de254d5b0cb in flume's branch refs/heads/flume-1.6 from Hari Shreedharan
        [ https://git-wip-us.apache.org/repos/asf?p=flume.git;h=e670cba ]

        FLUME-2472. SyslogUtils fails when system locale is not English

        (Santiago M. Mola via Hari)

        Show
        jira-bot ASF subversion and git services added a comment - Commit e670cba3f7b4e58b6a4756829ec25de254d5b0cb in flume's branch refs/heads/flume-1.6 from Hari Shreedharan [ https://git-wip-us.apache.org/repos/asf?p=flume.git;h=e670cba ] FLUME-2472 . SyslogUtils fails when system locale is not English (Santiago M. Mola via Hari)
        Hide
        hshreedharan Hari Shreedharan added a comment -

        Committed! Thanks Santiago!

        Show
        hshreedharan Hari Shreedharan added a comment - Committed! Thanks Santiago!
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in flume-trunk #670 (See https://builds.apache.org/job/flume-trunk/670/)
        FLUME-2472. SyslogUtils fails when system locale is not English (hshreedharan: http://git-wip-us.apache.org/repos/asf/flume/repo?p=flume.git&a=commit&h=72b54c9909290fa5b98123b4b0c1332a425c5c64)

        • flume-ng-core/src/main/java/org/apache/flume/source/SyslogUtils.java
        • flume-ng-core/src/test/java/org/apache/flume/source/TestSyslogUtils.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in flume-trunk #670 (See https://builds.apache.org/job/flume-trunk/670/ ) FLUME-2472 . SyslogUtils fails when system locale is not English (hshreedharan: http://git-wip-us.apache.org/repos/asf/flume/repo?p=flume.git&a=commit&h=72b54c9909290fa5b98123b4b0c1332a425c5c64 ) flume-ng-core/src/main/java/org/apache/flume/source/SyslogUtils.java flume-ng-core/src/test/java/org/apache/flume/source/TestSyslogUtils.java
        Hide
        hudson Hudson added a comment -

        UNSTABLE: Integrated in Flume-trunk-hbase-98 #30 (See https://builds.apache.org/job/Flume-trunk-hbase-98/30/)
        FLUME-2472. SyslogUtils fails when system locale is not English (hshreedharan: http://git-wip-us.apache.org/repos/asf/flume/repo?p=flume.git&a=commit&h=72b54c9909290fa5b98123b4b0c1332a425c5c64)

        • flume-ng-core/src/test/java/org/apache/flume/source/TestSyslogUtils.java
        • flume-ng-core/src/main/java/org/apache/flume/source/SyslogUtils.java
        Show
        hudson Hudson added a comment - UNSTABLE: Integrated in Flume-trunk-hbase-98 #30 (See https://builds.apache.org/job/Flume-trunk-hbase-98/30/ ) FLUME-2472 . SyslogUtils fails when system locale is not English (hshreedharan: http://git-wip-us.apache.org/repos/asf/flume/repo?p=flume.git&a=commit&h=72b54c9909290fa5b98123b4b0c1332a425c5c64 ) flume-ng-core/src/test/java/org/apache/flume/source/TestSyslogUtils.java flume-ng-core/src/main/java/org/apache/flume/source/SyslogUtils.java

          People

          • Assignee:
            smolav Santiago M. Mola
            Reporter:
            smolav Santiago M. Mola
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development