ActiveMQ
  1. ActiveMQ
  2. AMQ-1382

Unnecessary creation of /activemq-data/localhost/tmp_storage directory with AMQ 5.x

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Not a Problem
    • Affects Version/s: None
    • Fix Version/s: 5.3.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      NA

      Description

      With AMQ 5.0 everytime AMQ runs the following directory structure is created:

      /activemq-data/localhost/tmp_storage.

      This didn't happen in AMQ 4.1.0.X and looks to be a side effect of the new temporary spooling feature in 5.x.

      Since the broker is configured to be non-persistent, ActiveMQ should not be creating this directory.

        Activity

        Hide
        Hiram Chirino added a comment -

        fixed in rev 573397

        Show
        Hiram Chirino added a comment - fixed in rev 573397
        Hide
        Yuriy added a comment -

        This issue is reproduced in activemq 5.1.0

        The directory structure "activemq-data\localhost\tmp_storage" is created within current directory after starting of ActiveMQ.
        Persistent mode is used. Location of created directories is not controlled by "directory" attribute of amqPersistenceAdapter:
        directory structure is always created in current directory and "tmp_storage" folder remains empty.

        XML Configuration file:
        <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" persistent="true">
        ...
        <persistenceAdapter>
        <amqPersistenceAdapter syncOnWrite="false" directory="$

        {MYROOTl}

        /jmsserver/data" maxFileLength="100 mb"/>
        </persistenceAdapter>
        ...

        Show
        Yuriy added a comment - This issue is reproduced in activemq 5.1.0 The directory structure "activemq-data\localhost\tmp_storage" is created within current directory after starting of ActiveMQ. Persistent mode is used. Location of created directories is not controlled by "directory" attribute of amqPersistenceAdapter: directory structure is always created in current directory and "tmp_storage" folder remains empty. XML Configuration file: <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" persistent="true"> ... <persistenceAdapter> <amqPersistenceAdapter syncOnWrite="false" directory="$ {MYROOTl} /jmsserver/data" maxFileLength="100 mb"/> </persistenceAdapter> ...
        Hide
        Dima added a comment -

        the same thing
        tmp_storage creator ignores "directory" attribute
        I've just added "cd /var/lib/activemq" to my startup script

        Show
        Dima added a comment - the same thing tmp_storage creator ignores "directory" attribute I've just added "cd /var/lib/activemq" to my startup script
        Hide
        Alex Burgel added a comment -

        this still exists in 5.2-20080803.231633-64.

        a work around is to specify dataDirectory in your xml config like so:

        <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" persistent="true" dataDirectory="/var/lib/activemq/">

        the tmp directory will be created within dataDirectory.

        Show
        Alex Burgel added a comment - this still exists in 5.2-20080803.231633-64. a work around is to specify dataDirectory in your xml config like so: <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" persistent="true" dataDirectory="/var/lib/activemq/"> the tmp directory will be created within dataDirectory.
        Hide
        bill graham added a comment -

        FYI, the workaround mentioned above does not work in AMQ 5.1 or the latest activemq-core-5.3-20080911.231559-3 build. the settings for both dataDirectory and brokerName get ignored, regardless of whether I configure them on the broker or on the persistanceAdapter.

        Show
        bill graham added a comment - FYI, the workaround mentioned above does not work in AMQ 5.1 or the latest activemq-core-5.3-20080911.231559-3 build. the settings for both dataDirectory and brokerName get ignored, regardless of whether I configure them on the broker or on the persistanceAdapter.
        Hide
        Dave Stanley added a comment -

        As a workaround, I think changing the tmpDataDirectory in your spring configuration should allow you to configure the location of this directory @ a friendly location.

        <broker ... tmpDataDirectory="/somplace/tmp_storage" >
          ...
        </broker>
        
        Show
        Dave Stanley added a comment - As a workaround, I think changing the tmpDataDirectory in your spring configuration should allow you to configure the location of this directory @ a friendly location. <broker ... tmpDataDirectory= "/somplace/tmp_storage" > ... </broker>
        Hide
        Gary Tully added a comment -

        setting dataDirectoryFile or tmpDataDirectory (both of which take File object) in spring xml config will allow the temp directory to be specified in 5.3.
        An alternative is to specify the System Property ,
        'org.apache.activemq.default.directory.prefix' which will be prefixed to the default data directory location activemq-data

        Show
        Gary Tully added a comment - setting dataDirectoryFile or tmpDataDirectory (both of which take File object) in spring xml config will allow the temp directory to be specified in 5.3. An alternative is to specify the System Property , 'org.apache.activemq.default.directory.prefix' which will be prefixed to the default data directory location activemq-data
        Hide
        David Newcomb added a comment -

        Hiram Chirino said the issue was fixed on 06/Sep/07, but the comments suggest that the issue has reoccurred. This issue is marked as "Working as Designed" but the comments seem to say you should set the tmp Directory to something nicer.
        Has the original issue been fixed or not? I've got 5.2 and its still creating <somewhere>\activemq-data\localhost\tmp_storage. Has the code been fixed so that this folder is not created?

        Show
        David Newcomb added a comment - Hiram Chirino said the issue was fixed on 06/Sep/07, but the comments suggest that the issue has reoccurred. This issue is marked as "Working as Designed" but the comments seem to say you should set the tmp Directory to something nicer. Has the original issue been fixed or not? I've got 5.2 and its still creating <somewhere>\activemq-data\localhost\tmp_storage. Has the code been fixed so that this folder is not created?
        Hide
        Alex Kudlick added a comment -

        It's fixed. I attached a unit test patch that demonstrates that the bug exists using AMQ 5.2, but not in 5.4.2

        Show
        Alex Kudlick added a comment - It's fixed. I attached a unit test patch that demonstrates that the bug exists using AMQ 5.2, but not in 5.4.2
        Hide
        Bhanu added a comment -

        Seeing this issue in version 5.5.1
        tmp_storage is hogging about 2.8 gigs wheresas the actual kahadb_dir specified by me is only 340 megs.
        Weird thing is <activemq_data>/<broker_name>/tmp_storage gets created in our production setup but not test setup. What exactly does its creation depend upon ? and why does is it eating up so much space ?
        Guys, any help here ?

        Show
        Bhanu added a comment - Seeing this issue in version 5.5.1 tmp_storage is hogging about 2.8 gigs wheresas the actual kahadb_dir specified by me is only 340 megs. Weird thing is <activemq_data>/<broker_name>/tmp_storage gets created in our production setup but not test setup. What exactly does its creation depend upon ? and why does is it eating up so much space ? Guys, any help here ?
        Hide
        Bhanu added a comment -

        Also, In my jconsole for test setup I see under the broker bean that the attribute DataDirectory points to /u/testuser/activemq-data whereas no such directory is specified/created, all kahadb logs go to the directory specified in broker xml.

        Show
        Bhanu added a comment - Also, In my jconsole for test setup I see under the broker bean that the attribute DataDirectory points to /u/testuser/activemq-data whereas no such directory is specified/created, all kahadb logs go to the directory specified in broker xml.

          People

          • Assignee:
            Hiram Chirino
            Reporter:
            Dave Stanley
          • Votes:
            7 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development