You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flume.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2019/01/31 12:53:00 UTC

[jira] [Commented] (FLUME-3316) Syslog Rfc3164Date test fails when the test date falls on a leap day

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

ASF subversion and git services commented on FLUME-3316:
--------------------------------------------------------

Commit 41902ebc998ca31de4ddc0fb89136a2e70b236f9 in flume's branch refs/heads/trunk from turcsanyip
[ https://gitbox.apache.org/repos/asf?p=flume.git;h=41902eb ]

FLUME-3316 Fixed Syslog Rfc3164Date test failure when the test date falls on a leap day (#275)

Syslog Rfc3164Date test changes the time via a mock Clock instance so that it can test
dates in the past/future (it goes 13 months forward).
The test failed due to a bug in SyslogSource when the test date fell on a leap day (2020-02-29).

Background:
RFC 3164 Syslog messages do not contain the year and SyslogSource tries to find it out (in order to
set the timestamp Flume event header).
First it adds the current year, and then adjusts it with +/- 1 year if needed (it can happen
around 31 Dec / 1 Jan).
In the previous implementation SyslogSource added the current year based on the system time,
not the (mocked) Clock instance.
When the test date was 2020-02-29 (so the syslog message contained Feb 29), SyslogSource added
2019 to Feb 29 which is not a real date and was parsed to 2019-03-01, then adjusted with +1 year
to 2020-03-01. This caused the test error.

Solution:
SyslogSource has been modified to use the Clock instance when adding the current year to the
date coming in the syslog message.
The year was also set in another place in the code which was redundant (and used deprecated
Date API), so it has been deleted too.

> Syslog Rfc3164Date test fails when the test date falls on a leap day
> --------------------------------------------------------------------
>
>                 Key: FLUME-3316
>                 URL: https://issues.apache.org/jira/browse/FLUME-3316
>             Project: Flume
>          Issue Type: Bug
>            Reporter: Peter Turcsanyi
>            Assignee: Peter Turcsanyi
>            Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@flume.apache.org
For additional commands, e-mail: issues-help@flume.apache.org