logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LOG4J2-296) Wasted work in FlumePersistentManager.createManager
Date Tue, 02 Jul 2013 05:47:20 GMT

     [ https://issues.apache.org/jira/browse/LOG4J2-296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Gary Gregory updated LOG4J2-296:
--------------------------------

    Description: 
The problem appears in Log4j 2.0-beta7 and in revision 1497930.  I
attached a one-line patch that fixes it.

In method "FlumePersistentManager.createManager", the loop over
"properties.entrySet()" should break immediately after "key" is set
the first time to "entry.getValue()".  I don't think "key" is set a
second time (and therefore all future iterations are not useful), but
if it is, then there is a problem in the implementation: when the loop
exits, "key" would be set to the last value of "entry.getValue()" that
meets some condition; however "properties.entrySet()" is a Set and
therefore the order of iterating it is non-deterministic, i.e., the
implementation should not rely on which the "last value" is.

  was:
The problem appears in Log4j 2.0-beta7 and in revision 1497930.  I
attached a one-line patch that fixes it.

In method "BDBManagerFactory.createManager", the loop over
"properties.entrySet()" should break immediately after "key" is set
the first time to "entry.getValue()".  I don't think "key" is set a
second time (and therefore all future iterations are not useful), but
if it is, then there is a problem in the implementation: when the loop
exits, "key" would be set to the last value of "entry.getValue()" that
meets some condition; however "properties.entrySet()" is a Set and
therefore the order of iterating it is non-deterministic, i.e., the
implementation should not rely on which the "last value" is.

    
> Wasted work in FlumePersistentManager.createManager
> ---------------------------------------------------
>
>                 Key: LOG4J2-296
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-296
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Flume Appender
>    Affects Versions: 2.0-beta7
>         Environment: any
>            Reporter: Adrian Nistor
>              Labels: patch, performance
>         Attachments: patch.diff
>
>
> The problem appears in Log4j 2.0-beta7 and in revision 1497930.  I
> attached a one-line patch that fixes it.
> In method "FlumePersistentManager.createManager", the loop over
> "properties.entrySet()" should break immediately after "key" is set
> the first time to "entry.getValue()".  I don't think "key" is set a
> second time (and therefore all future iterations are not useful), but
> if it is, then there is a problem in the implementation: when the loop
> exits, "key" would be set to the last value of "entry.getValue()" that
> meets some condition; however "properties.entrySet()" is a Set and
> therefore the order of iterating it is non-deterministic, i.e., the
> implementation should not rely on which the "last value" is.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message