You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Michael Herrmann (Created) (JIRA)" <se...@james.apache.org> on 2011/10/07 15:21:30 UTC
[jira] [Created] (JAMES-1327)
FileSystemBlobStrategy#getFile(ActiveMQBlobMessage) is not thread safe
(throws "java.io.IOException: Unable to create directory")
FileSystemBlobStrategy#getFile(ActiveMQBlobMessage) is not thread safe (throws "java.io.IOException: Unable to create directory")
---------------------------------------------------------------------------------------------------------------------------------
Key: JAMES-1327
URL: https://issues.apache.org/jira/browse/JAMES-1327
Project: JAMES Server
Issue Type: Bug
Components: Queue
Affects Versions: 3.0-beta3
Environment: At least Windows and Linux.
Reporter: Michael Herrmann
Consider org.apache.james.queue.activemq.FileSystemBlobStrategy#getFile(ActiveMQBlobMessage):
protected File getFile(ActiveMQBlobMessage message) throws JMSException, IOException {
...
// check if we need to create the queue folder
if (queueF.exists() == false) {
if (!queueF.mkdirs()) {
throw new IOException("Unable to create directory " + queueF.getAbsolutePath());
}
}
...
}
Suppose this method is called from two threads. If both threads get past the condition
if (queueF.exists() == false),
then the first one will create queueF. For the second, queueF.mkdirs() will then return false, which leads to an IOException even though everything is fine. I think the condition should be replaced by
if (!queueF.mkdirs() && !queueF.exists()).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[jira] [Resolved] (JAMES-1327)
FileSystemBlobStrategy#getFile(ActiveMQBlobMessage) is not thread safe
(throws "java.io.IOException: Unable to create directory")
Posted by "Norman Maurer (Resolved) (JIRA)" <se...@james.apache.org>.
[ https://issues.apache.org/jira/browse/JAMES-1327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Norman Maurer resolved JAMES-1327.
----------------------------------
Resolution: Fixed
Fix Version/s: 3.0-beta4
Assignee: Norman Maurer
Patch applied. Thanks again...
> FileSystemBlobStrategy#getFile(ActiveMQBlobMessage) is not thread safe (throws "java.io.IOException: Unable to create directory")
> ---------------------------------------------------------------------------------------------------------------------------------
>
> Key: JAMES-1327
> URL: https://issues.apache.org/jira/browse/JAMES-1327
> Project: JAMES Server
> Issue Type: Bug
> Components: Queue
> Affects Versions: 3.0-beta3
> Environment: At least Windows and Linux.
> Reporter: Michael Herrmann
> Assignee: Norman Maurer
> Fix For: 3.0-beta4
>
> Attachments: JAMES-1327.patch
>
>
> Consider org.apache.james.queue.activemq.FileSystemBlobStrategy#getFile(ActiveMQBlobMessage):
> protected File getFile(ActiveMQBlobMessage message) throws JMSException, IOException {
> ...
> // check if we need to create the queue folder
> if (queueF.exists() == false) {
> if (!queueF.mkdirs()) {
> throw new IOException("Unable to create directory " + queueF.getAbsolutePath());
> }
> }
> ...
> }
> Suppose this method is called from two threads. If both threads get past the condition
> if (queueF.exists() == false),
> then the first one will create queueF. For the second, queueF.mkdirs() will then return false, which leads to an IOException even though everything is fine. I think the condition should be replaced by
> if (!queueF.mkdirs() && !queueF.exists()).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[jira] [Updated] (JAMES-1327)
FileSystemBlobStrategy#getFile(ActiveMQBlobMessage) is not thread safe
(throws "java.io.IOException: Unable to create directory")
Posted by "Michael Herrmann (Updated) (JIRA)" <se...@james.apache.org>.
[ https://issues.apache.org/jira/browse/JAMES-1327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Herrmann updated JAMES-1327:
------------------------------------
Attachment: JAMES-1327.patch
Patch attached :)
> FileSystemBlobStrategy#getFile(ActiveMQBlobMessage) is not thread safe (throws "java.io.IOException: Unable to create directory")
> ---------------------------------------------------------------------------------------------------------------------------------
>
> Key: JAMES-1327
> URL: https://issues.apache.org/jira/browse/JAMES-1327
> Project: JAMES Server
> Issue Type: Bug
> Components: Queue
> Affects Versions: 3.0-beta3
> Environment: At least Windows and Linux.
> Reporter: Michael Herrmann
> Attachments: JAMES-1327.patch
>
>
> Consider org.apache.james.queue.activemq.FileSystemBlobStrategy#getFile(ActiveMQBlobMessage):
> protected File getFile(ActiveMQBlobMessage message) throws JMSException, IOException {
> ...
> // check if we need to create the queue folder
> if (queueF.exists() == false) {
> if (!queueF.mkdirs()) {
> throw new IOException("Unable to create directory " + queueF.getAbsolutePath());
> }
> }
> ...
> }
> Suppose this method is called from two threads. If both threads get past the condition
> if (queueF.exists() == false),
> then the first one will create queueF. For the second, queueF.mkdirs() will then return false, which leads to an IOException even though everything is fine. I think the condition should be replaced by
> if (!queueF.mkdirs() && !queueF.exists()).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[jira] [Commented] (JAMES-1327)
FileSystemBlobStrategy#getFile(ActiveMQBlobMessage) is not thread safe
(throws "java.io.IOException: Unable to create directory")
Posted by "Norman Maurer (Commented) (JIRA)" <se...@james.apache.org>.
[ https://issues.apache.org/jira/browse/JAMES-1327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13122788#comment-13122788 ]
Norman Maurer commented on JAMES-1327:
--------------------------------------
What about creating a patch file... We love contributions :)
> FileSystemBlobStrategy#getFile(ActiveMQBlobMessage) is not thread safe (throws "java.io.IOException: Unable to create directory")
> ---------------------------------------------------------------------------------------------------------------------------------
>
> Key: JAMES-1327
> URL: https://issues.apache.org/jira/browse/JAMES-1327
> Project: JAMES Server
> Issue Type: Bug
> Components: Queue
> Affects Versions: 3.0-beta3
> Environment: At least Windows and Linux.
> Reporter: Michael Herrmann
>
> Consider org.apache.james.queue.activemq.FileSystemBlobStrategy#getFile(ActiveMQBlobMessage):
> protected File getFile(ActiveMQBlobMessage message) throws JMSException, IOException {
> ...
> // check if we need to create the queue folder
> if (queueF.exists() == false) {
> if (!queueF.mkdirs()) {
> throw new IOException("Unable to create directory " + queueF.getAbsolutePath());
> }
> }
> ...
> }
> Suppose this method is called from two threads. If both threads get past the condition
> if (queueF.exists() == false),
> then the first one will create queueF. For the second, queueF.mkdirs() will then return false, which leads to an IOException even though everything is fine. I think the condition should be replaced by
> if (!queueF.mkdirs() && !queueF.exists()).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org