activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shahram Javey (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (AMQ-1380) ActiveIO does not close ControlFile
Date Mon, 28 Jan 2008 05:55:31 GMT

    [ https://issues.apache.org/activemq/browse/AMQ-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=41168#action_41168
] 

palmsun edited comment on AMQ-1380 at 1/27/08 9:54 PM:
-------------------------------------------------------------

This patch is still not part of ActiveMQ 5.0,  where slave file handle leaks are still an
issue. I manually applied this patch and it fixed the problem. Why is this patch not part
of 5.0? Running a master/slave (persistence based on journal file-system) using a conf file
below, leads to the crash of the slave after a few hours, due to running out of open files.
If you monitor the number of open files (lsof | wc -l), you'll see that the number of open
files keeps increasing every 10 seconds. With this patch, this is no-longer a problem. Please
include this patch in the release. Here is the conf file that I've used for master/slave (the
only difference is that the value of the IP address in the  broker name and the  transport
connector)

<beans
  xmlns="http://www.springframework.org/schema/beans"
  xmlns:amq="http://activemq.org/config/1.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
  http://activemq.org/config/1.0 http://activemq.apache.org/schema/activemq-core.xsd
  http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">

  <!-- Allows us to use system properties as variables in this configuration file -->
  <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
  
  <broker xmlns="http://activemq.org/config/1.0" brokerName="10.0.1.200" useJmx="false">
  
    <!-- The transport connectors ActiveMQ will listen to -->
    <transportConnectors>
       <transportConnector name="openwire" uri="tcp://10.0.1.200:61616?trace=true"/>
    </transportConnectors>
	<persistenceAdapter>
	      <journaledJDBC dataDirectory="/Users/sjavey/amq-broker-data"/>
	</persistenceAdapter>

  </broker>

  <!-- An embedded servlet engine for serving up the Admin console -->
  <jetty xmlns="http://mortbay.com/schemas/jetty/1.0">
    <connectors>
      <nioConnector port="8161" />
    </connectors>

    <handlers>
      <webAppContext contextPath="/admin" resourceBase="${activemq.base}/webapps/admin"
logUrlOnStart="true" />
    </handlers>
  </jetty>
  
</beans>

      was (Author: palmsun):
    This patch is still not part of ActiveMQ 5.0,  where slave file handle leaks are still
an issue. I manually applied this patch and it fixed the problem. Why is this patch not part
of 5.0? Running a master/slave (persistence based on journal file-system) using a conf file
below, leads to the crash of the slave after a few hours, due to running out of open files.
If you monitor the number of open files (lsof | wc -l), you'll see that the number of open
files keeps increasing every 10 seconds. With this patch, this is no-longer a problem. Please
include this patch in the release. 

<beans
  xmlns="http://www.springframework.org/schema/beans"
  xmlns:amq="http://activemq.org/config/1.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
  http://activemq.org/config/1.0 http://activemq.apache.org/schema/activemq-core.xsd
  http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">

  <!-- Allows us to use system properties as variables in this configuration file -->
  <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
  
  <broker xmlns="http://activemq.org/config/1.0" brokerName="10.0.1.200" useJmx="false">
  
    <!-- The transport connectors ActiveMQ will listen to -->
    <transportConnectors>
       <transportConnector name="openwire" uri="tcp://10.0.1.200:61616?trace=true"/>
    </transportConnectors>
	<persistenceAdapter>
	      <journaledJDBC dataDirectory="/Users/sjavey/amq-broker-data"/>
	</persistenceAdapter>

  </broker>

  <!-- An embedded servlet engine for serving up the Admin console -->
  <jetty xmlns="http://mortbay.com/schemas/jetty/1.0">
    <connectors>
      <nioConnector port="8161" />
    </connectors>

    <handlers>
      <webAppContext contextPath="/admin" resourceBase="${activemq.base}/webapps/admin"
logUrlOnStart="true" />
    </handlers>
  </jetty>
  
</beans>
  
> ActiveIO does not close ControlFile 
> ------------------------------------
>
>                 Key: AMQ-1380
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1380
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 4.1.1
>         Environment: All
>            Reporter: Joe Kutner
>         Attachments: patch.txt
>
>
> The following exception is thrown from an ActiveMQ instance that is in Slave mode that
causes it to crash.
> java.io.FileNotFoundException: ***/*******/*****/*******/journal/control.dat (Too many
open files)
>         at java.io.RandomAccessFile.open(Native Method)
>         at java.io.RandomAccessFile.<init>(RandomAccessFile.java:212)
>         at org.apache.activeio.journal.active.ControlFile.<init>(ControlFile.java:60)
>         at org.apache.activeio.journal.active.LogFileManager.initialize(LogFileManager.java:119)
>         at org.apache.activeio.journal.active.LogFileManager.<init>(LogFileManager.java:102)
>         at org.apache.activeio.journal.active.JournalImpl.<init>(JournalImpl.java:101)
>         at org.apache.activemq.store.DefaultPersistenceAdapterFactory.createJournal(DefaultPersistenceAdapterFactory.java:224)
>         at org.apache.activemq.store.DefaultPersistenceAdapterFactory.getJournal(DefaultPersistenceAdapterFactory.java:132)
>         at org.apache.activemq.store.DefaultPersistenceAdapterFactory.createPersistenceAdapter(DefaultPersistenceAdapterFactory.java:70)
>         at org.apache.activemq.store.PersistenceAdapterFactoryBean.getObject(PersistenceAdapterFactoryBean.java:35)
>         at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectFromFactoryBean(AbstractBeanFactory.java:994)
>         ... 41 more
> The problem is that each time ActiveIO checks to see if control.dat is locked it creates
a new java.io.RandomAccessFile.  If the control.dat file is locked, it fails to close the
RandomAccessFile.
> This exception always will be thrown from an instance in Shared-File-System Slave mode
that continues to check the Journal file (which the Master has locked).  But the rate at which
is is thrown depends on the maximum number of files the OS allows to be open.  You can check
how many files are open with 'ulimit -a'

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message