[jira] Created: (CAMEL-62) file locking should be enabled by default and keep the lock until the file is processed

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (CAMEL-62) file locking should be enabled by default and keep the lock until the file is processed

JIRA jira@apache.org
file locking should be enabled by default and keep the lock until the file is processed
---------------------------------------------------------------------------------------

                 Key: CAMEL-62
                 URL: https://issues.apache.org/activemq/browse/CAMEL-62
             Project: Apache Camel
          Issue Type: Improvement
            Reporter: James Strachan
            Assignee: James Strachan
             Fix For: 1.1




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

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (CAMEL-62) file locking should be enabled by default and keep the lock until the file is processed

JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-62?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Strachan resolved CAMEL-62.
---------------------------------

    Resolution: Fixed

file locking now enabled by default for the duration of the processor

> file locking should be enabled by default and keep the lock until the file is processed
> ---------------------------------------------------------------------------------------
>
>                 Key: CAMEL-62
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-62
>             Project: Apache Camel
>          Issue Type: Improvement
>            Reporter: James Strachan
>            Assignee: James Strachan
>             Fix For: 1.1
>
>


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

Reply | Threaded
Open this post in threaded view
|

Re: [jira] Created: (CAMEL-62) file locking should be enabled by default and keep the lock until the file is processed

Willem.Jiang
Administrator
In reply to this post by JIRA jira@apache.org
Hi James,

I just test this  lock feature on the windows box by run mvn install in
the trunk.
I found the RenameFileStrategy  will  not  rename the file successfully
when the old file is locked.
So I think we can get find some way to do this file's lock job by a
logic lock or do some thing to walk around.

Any Thoughts?

Willem.

James Strachan (JIRA) wrote:

> file locking should be enabled by default and keep the lock until the file is processed
> ---------------------------------------------------------------------------------------
>
>                  Key: CAMEL-62
>                  URL: https://issues.apache.org/activemq/browse/CAMEL-62
>              Project: Apache Camel
>           Issue Type: Improvement
>             Reporter: James Strachan
>             Assignee: James Strachan
>              Fix For: 1.1
>
>
>
>
>  

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-62) file locking should be enabled by default and keep the lock until the file is processed

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39629 ]

Willem Jiang commented on CAMEL-62:
-----------------------------------

I just test this  lock feature in the windows box by run the unit test of file endpoint in the trunk.

I found the RenameFileStrategy  will  not  rename the file successfully when the old file is locked.
So I think we can get find some way to do this file's lock job by a logic lock or do some thing to walk around.



> file locking should be enabled by default and keep the lock until the file is processed
> ---------------------------------------------------------------------------------------
>
>                 Key: CAMEL-62
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-62
>             Project: Apache Camel
>          Issue Type: Improvement
>            Reporter: James Strachan
>            Assignee: James Strachan
>             Fix For: 1.1.0
>
>


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

Reply | Threaded
Open this post in threaded view
|

[jira] Reopened: (CAMEL-62) file locking should be enabled by default and keep the lock until the file is processed

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-62?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang reopened CAMEL-62:
-------------------------------


> file locking should be enabled by default and keep the lock until the file is processed
> ---------------------------------------------------------------------------------------
>
>                 Key: CAMEL-62
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-62
>             Project: Apache Camel
>          Issue Type: Improvement
>            Reporter: James Strachan
>            Assignee: James Strachan
>             Fix For: 1.1.0
>
>


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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-62) file locking should be enabled by default and keep the lock until the file is processed

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39631 ]

James Strachan commented on CAMEL-62:
-------------------------------------

Just checking I understand what you're staying corectly. You're saying that the rename doesn't work if the RenameFileStrategy grabs the lock first on the old file? Or is it if some other process has that lock?

> file locking should be enabled by default and keep the lock until the file is processed
> ---------------------------------------------------------------------------------------
>
>                 Key: CAMEL-62
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-62
>             Project: Apache Camel
>          Issue Type: Improvement
>            Reporter: James Strachan
>            Assignee: James Strachan
>             Fix For: 1.1.0
>
>


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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-62) file locking should be enabled by default and keep the lock until the file is processed

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39632 ]

Willem Jiang commented on CAMEL-62:
-----------------------------------

yes, the file which handled by RenameFileStrategy will be locked by RenameFileStrategy  first.
It looks FileEndpoint will set the strategy to lock the file first .

> file locking should be enabled by default and keep the lock until the file is processed
> ---------------------------------------------------------------------------------------
>
>                 Key: CAMEL-62
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-62
>             Project: Apache Camel
>          Issue Type: Improvement
>            Reporter: James Strachan
>            Assignee: James Strachan
>             Fix For: 1.1.0
>
>


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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-62) file locking should be enabled by default and keep the lock until the file is processed

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39633 ]

James Strachan commented on CAMEL-62:
-------------------------------------

BTW I've added an exception throwing to the RenameFileStrategy if the rename doens't work.

I think going forward we need to introduce a separate lock file (with the file name based on the name of the original. e.g. for a file foo/bar.txt we use foo/bar.text.lock as the lock file); then we lock that first; once the file is locked we can then move / delete the original

> file locking should be enabled by default and keep the lock until the file is processed
> ---------------------------------------------------------------------------------------
>
>                 Key: CAMEL-62
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-62
>             Project: Apache Camel
>          Issue Type: Improvement
>            Reporter: James Strachan
>            Assignee: James Strachan
>             Fix For: 1.1.0
>
>


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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-62) file locking should be enabled by default and keep the lock until the file is processed

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-62?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39682 ]

Willem Jiang commented on CAMEL-62:
-----------------------------------

James, I just changed some code of the FileStategySupport as you mentioned,  and tested it against the last code.
I will attach the patch for it . Please have a look at it.


> file locking should be enabled by default and keep the lock until the file is processed
> ---------------------------------------------------------------------------------------
>
>                 Key: CAMEL-62
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-62
>             Project: Apache Camel
>          Issue Type: Improvement
>            Reporter: James Strachan
>            Assignee: James Strachan
>             Fix For: 1.1.0
>
>


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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (CAMEL-62) file locking should be enabled by default and keep the lock until the file is processed

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-62?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang updated CAMEL-62:
------------------------------

    Attachment: FileStategySupport.patch

I tested this patch in windows, please verify it in others box.

> file locking should be enabled by default and keep the lock until the file is processed
> ---------------------------------------------------------------------------------------
>
>                 Key: CAMEL-62
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-62
>             Project: Apache Camel
>          Issue Type: Improvement
>            Reporter: James Strachan
>            Assignee: James Strachan
>             Fix For: 1.1.0
>
>         Attachments: FileStategySupport.patch
>
>


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

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (CAMEL-62) file locking should be enabled by default and keep the lock until the file is processed

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-62?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Strachan resolved CAMEL-62.
---------------------------------

    Resolution: Fixed

Patch applied with thanks - rev 558732. Many thanks!

> file locking should be enabled by default and keep the lock until the file is processed
> ---------------------------------------------------------------------------------------
>
>                 Key: CAMEL-62
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-62
>             Project: Apache Camel
>          Issue Type: Improvement
>            Reporter: James Strachan
>            Assignee: James Strachan
>             Fix For: 1.1.0
>
>         Attachments: FileStategySupport.patch
>
>


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