Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 63300 invoked from network); 17 Jun 2008 16:23:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Jun 2008 16:23:51 -0000 Received: (qmail 19533 invoked by uid 500); 17 Jun 2008 16:23:53 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 19354 invoked by uid 500); 17 Jun 2008 16:23:53 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 19343 invoked by uid 99); 17 Jun 2008 16:23:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jun 2008 09:23:53 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jun 2008 16:23:11 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 48970234C142 for ; Tue, 17 Jun 2008 09:23:00 -0700 (PDT) Message-ID: <1564562934.1213719780291.JavaMail.jira@brutus> Date: Tue, 17 Jun 2008 09:23:00 -0700 (PDT) From: "Allen Yu (JIRA)" To: dev@activemq.apache.org Subject: [jira] Updated: (AMQ-1805) Persistent message leak when broker run out of disk space In-Reply-To: <1367011392.1213717862524.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/AMQ-1805?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Allen Yu updated AMQ-1805: -------------------------- Attachment: amq-1805.diff >From the above 5.1 source code, it seems like allocateLocation should actually make sure that there is enough disk space for the particular message. However, it actually only create the File handle without actually allocating any disk space So to fix this problem, we added nextWriteFile.closeRandomAccessFile(nextWriteFile.openRandomAccessFile(true)); in the AsyncDataManager.allocateLocation method to try and pre allocate the disk space. We believe that this will not have much impact on the performance as data file is 32MB default, but please feel free to advice otherwise as this is our first time looking at ActiveMQ source code. > Persistent message leak when broker run out of disk space > --------------------------------------------------------- > > Key: AMQ-1805 > URL: https://issues.apache.org/activemq/browse/AMQ-1805 > Project: ActiveMQ > Issue Type: Bug > Components: Broker > Affects Versions: 5.1.0 > Environment: ActiveMQ 5.1 (AMQStore w/o SystemUsage configuration) > Windows XP SP2 > ActiveMQ CPP 2.1.3 > Reporter: Allen Yu > Attachments: amq-1805.diff > > > In our environment, we have several ActvieMQ CPP clients sending persistent messages continuously to a ActiveMQ 5.1 broker. In normal condition the broker works fine until it ran out of disk space. At that point the client would receive out of disk space advisory message AFTER sending the message, therefore the message should be removed from broker, however, the message are kept in the memory due to a problem in the DataFileAppender & AsyncDatamanager, when the disk is full, the message is saved in the inflightWrites map but never taken out since the enqueue will fail due to IOException. > synchronized (this) { > // Find the position where this item will land at. > DataFile dataFile = dataManager.allocateLocation(location); > if( !sync ) { > inflightWrites.put(new WriteKey(location), write); > } > batch = enqueue(dataFile, write); > } > and > synchronized (this) { > // Find the position where this item will land at. > DataFile dataFile = dataManager.allocateLocation(location); > inflightWrites.put(new WriteKey(location), write); > batch = enqueue(dataFile, write); > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.