You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Álvaro Alda <aa...@gmail.com> on 2011/11/29 17:00:21 UTC

Bug found with logging

Hi everyone!

On my company we have two instances of Fuse/Servicemix 4.3.0 (which uses
Karaf 2.0.0) with a Master/Slave failover configuration. Specifically, we
use the simple lock file mechanism. The logging system is configured with a
/RollingFileAppender/. After several days without restarting the servers, we
noticed that the hard drive partition was getting strangely full. With
/"lsof | grep deleted"/ command we have realized that there is a
servicemix.log.10 ghost file that is growing continuously. If you start two
instances with this configuration and use the /"lsof"/ tool, you will
realize that the same java process opens two file descriptors of the same
log file. One of them rolls until the file system tries to remove it.

I have searched in the source code of Karaf and found the problem. The
method getDefaultHandler() in class
/org.apache.karaf.main.BootstrapLogManager/ is been invoked twice, one time
in org.apache.karaf.main.Main and another one in
/org.apache.karaf.main.SimpleFileLock/ class (or /DefaultJDBCLock/). But it
seems that the singleton pattern isn't implemented well because everytime
this method is called, a new object instance of the /Handler/ class is
created without closing the previous instance. The close() method must be
called in order to release the output stream correctly.

I have checked that this problem persists through all releases of Karaf,
including latest one.

Regards
Álvaro

--
View this message in context: http://karaf.922171.n3.nabble.com/Bug-found-with-logging-tp3545618p3545618.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Bug found with logging

Posted by Álvaro Alda <aa...@gmail.com>.
Issue opened: https://issues.apache.org/jira/browse/KARAF-1064

Regards

--
View this message in context: http://karaf.922171.n3.nabble.com/Bug-found-with-logging-tp3545618p3547585.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Bug found with logging

Posted by Achim Nierbeck <bc...@googlemail.com>.
Do you mind opening an issue for this,
and since you already found a solution for it to attach a patch to it?

Regards, Achim

2011/11/29 Álvaro Alda <aa...@gmail.com>

> Hi everyone!
>
> On my company we have two instances of Fuse/Servicemix 4.3.0 (which uses
> Karaf 2.0.0) with a Master/Slave failover configuration. Specifically, we
> use the simple lock file mechanism. The logging system is configured with a
> /RollingFileAppender/. After several days without restarting the servers,
> we
> noticed that the hard drive partition was getting strangely full. With
> /"lsof | grep deleted"/ command we have realized that there is a
> servicemix.log.10 ghost file that is growing continuously. If you start two
> instances with this configuration and use the /"lsof"/ tool, you will
> realize that the same java process opens two file descriptors of the same
> log file. One of them rolls until the file system tries to remove it.
>
> I have searched in the source code of Karaf and found the problem. The
> method getDefaultHandler() in class
> /org.apache.karaf.main.BootstrapLogManager/ is been invoked twice, one time
> in org.apache.karaf.main.Main and another one in
> /org.apache.karaf.main.SimpleFileLock/ class (or /DefaultJDBCLock/). But it
> seems that the singleton pattern isn't implemented well because everytime
> this method is called, a new object instance of the /Handler/ class is
> created without closing the previous instance. The close() method must be
> called in order to release the output stream correctly.
>
> I have checked that this problem persists through all releases of Karaf,
> including latest one.
>
> Regards
> Álvaro
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Bug-found-with-logging-tp3545618p3545618.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 

Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>