You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2009/08/07 13:40:15 UTC
[jira] Created: (FELIX-1461) Corrupted repository.xml when maven is
run in parallel
Corrupted repository.xml when maven is run in parallel
------------------------------------------------------
Key: FELIX-1461
URL: https://issues.apache.org/jira/browse/FELIX-1461
Project: Felix
Issue Type: Bug
Components: Maven Bundle Plugin
Affects Versions: maven-bundle-plugin-1.4.3
Reporter: Carsten Ziegeler
Sometimes I'm running several maven commands in parallel (different shells) and sometimes in these cases this ends in a corrupted repository.xml.
It seems that in this case the repository.xml just contains this single line:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
which produces errors when it is tried to be read again.
I guess that there are not that many people running maven in parallel but I think the repository.xml shouldn't be corrupted/erased in these cases either :)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (FELIX-1461) Corrupted repository.xml when maven
is run in parallel
Posted by "Holger Hoffstätte (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-1461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12750988#action_12750988 ]
Holger Hoffstätte commented on FELIX-1461:
------------------------------------------
One possible and low-impactish-way to treat this could be taking the ctime/mtime of the file, create your new file, and only overwrite if the mtime has not changed; otherwise recreate. Basically CAS/retry for files..
> Corrupted repository.xml when maven is run in parallel
> ------------------------------------------------------
>
> Key: FELIX-1461
> URL: https://issues.apache.org/jira/browse/FELIX-1461
> Project: Felix
> Issue Type: Bug
> Components: Maven Bundle Plugin
> Affects Versions: maven-bundle-plugin-1.4.3
> Reporter: Carsten Ziegeler
> Assignee: Stuart McCulloch
> Fix For: maven-bundle-plugin-2.0.1
>
>
> Sometimes I'm running several maven commands in parallel (different shells) and sometimes in these cases this ends in a corrupted repository.xml.
> It seems that in this case the repository.xml just contains this single line:
> <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
> which produces errors when it is tried to be read again.
> I guess that there are not that many people running maven in parallel but I think the repository.xml shouldn't be corrupted/erased in these cases either :)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (FELIX-1461) Corrupted repository.xml when maven
is run in parallel
Posted by "Holger Hoffstätte (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-1461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12750985#action_12750985 ]
Holger Hoffstätte commented on FELIX-1461:
------------------------------------------
But now you've traded corruption for (possible) silent data loss. It is simply not possible to fix this without a lockfile..which you then need to cleanup if it is stale.. ad inf. :(
> Corrupted repository.xml when maven is run in parallel
> ------------------------------------------------------
>
> Key: FELIX-1461
> URL: https://issues.apache.org/jira/browse/FELIX-1461
> Project: Felix
> Issue Type: Bug
> Components: Maven Bundle Plugin
> Affects Versions: maven-bundle-plugin-1.4.3
> Reporter: Carsten Ziegeler
> Assignee: Stuart McCulloch
> Fix For: maven-bundle-plugin-2.0.1
>
>
> Sometimes I'm running several maven commands in parallel (different shells) and sometimes in these cases this ends in a corrupted repository.xml.
> It seems that in this case the repository.xml just contains this single line:
> <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
> which produces errors when it is tried to be read again.
> I guess that there are not that many people running maven in parallel but I think the repository.xml shouldn't be corrupted/erased in these cases either :)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (FELIX-1461) Corrupted repository.xml when maven
is run in parallel
Posted by "Stuart McCulloch (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-1461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stuart McCulloch resolved FELIX-1461.
-------------------------------------
Resolution: Fixed
I've tweaked the code so it uses a temporary file to build the updated OBR, it only overwrites the old file when the new file is complete. This should radically reduce the chance of getting a corrupted OBR - that said, it is considered Maven best-practice to not run parallel builds that use the same local repository.
> Corrupted repository.xml when maven is run in parallel
> ------------------------------------------------------
>
> Key: FELIX-1461
> URL: https://issues.apache.org/jira/browse/FELIX-1461
> Project: Felix
> Issue Type: Bug
> Components: Maven Bundle Plugin
> Affects Versions: maven-bundle-plugin-1.4.3
> Reporter: Carsten Ziegeler
> Assignee: Stuart McCulloch
> Fix For: maven-bundle-plugin-2.0.1
>
>
> Sometimes I'm running several maven commands in parallel (different shells) and sometimes in these cases this ends in a corrupted repository.xml.
> It seems that in this case the repository.xml just contains this single line:
> <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
> which produces errors when it is tried to be read again.
> I guess that there are not that many people running maven in parallel but I think the repository.xml shouldn't be corrupted/erased in these cases either :)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (FELIX-1461) Corrupted repository.xml when maven is
run in parallel
Posted by "Stuart McCulloch (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-1461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stuart McCulloch updated FELIX-1461:
------------------------------------
Fix Version/s: maven-bundle-plugin-2.0.1
> Corrupted repository.xml when maven is run in parallel
> ------------------------------------------------------
>
> Key: FELIX-1461
> URL: https://issues.apache.org/jira/browse/FELIX-1461
> Project: Felix
> Issue Type: Bug
> Components: Maven Bundle Plugin
> Affects Versions: maven-bundle-plugin-1.4.3
> Reporter: Carsten Ziegeler
> Assignee: Stuart McCulloch
> Fix For: maven-bundle-plugin-2.0.1
>
>
> Sometimes I'm running several maven commands in parallel (different shells) and sometimes in these cases this ends in a corrupted repository.xml.
> It seems that in this case the repository.xml just contains this single line:
> <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
> which produces errors when it is tried to be read again.
> I guess that there are not that many people running maven in parallel but I think the repository.xml shouldn't be corrupted/erased in these cases either :)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (FELIX-1461) Corrupted repository.xml when maven
is run in parallel
Posted by "Stefan Seifert (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-1461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12740518#action_12740518 ]
Stefan Seifert commented on FELIX-1461:
---------------------------------------
we've encountered this problem too multiple times the last months, i think i can happen as well if a running maven build is killed by CTRL+C.
i was not sure if it is general maven-specific problem or specific to this plugin.
> Corrupted repository.xml when maven is run in parallel
> ------------------------------------------------------
>
> Key: FELIX-1461
> URL: https://issues.apache.org/jira/browse/FELIX-1461
> Project: Felix
> Issue Type: Bug
> Components: Maven Bundle Plugin
> Affects Versions: maven-bundle-plugin-1.4.3
> Reporter: Carsten Ziegeler
>
> Sometimes I'm running several maven commands in parallel (different shells) and sometimes in these cases this ends in a corrupted repository.xml.
> It seems that in this case the repository.xml just contains this single line:
> <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
> which produces errors when it is tried to be read again.
> I guess that there are not that many people running maven in parallel but I think the repository.xml shouldn't be corrupted/erased in these cases either :)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (FELIX-1461) Corrupted repository.xml when maven
is run in parallel
Posted by "Stuart McCulloch (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-1461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12751001#action_12751001 ]
Stuart McCulloch commented on FELIX-1461:
-----------------------------------------
Exactly - before this fix it was possible to trash the repository file which meant you had to completely zap it, losing everything.
Now we at least make sure the repository file is consistent, so although you may lose an entry you could check and try again.
Also Maven has a fundamental design issue where running two processes against the same local repository could lead to
corrupt Maven metadata (this is well known, which is why many CI machines use separate repositories for different builds).
So I'm not sure how much time we should spend trying to workaround something that Maven itself doesn't support.
Adding a ctime/mtime check would be an option, but we'd need to limit the number of retries - otherwise you could end up in
some sort of live-lock situation. Even then it's possible to end up with missing data, as timestamps have limited granularity.
If someone wants to write a patch I'd be happy to integrate it, but for 2.0.1 this is the least disruptive solution to avoid corruption.
> Corrupted repository.xml when maven is run in parallel
> ------------------------------------------------------
>
> Key: FELIX-1461
> URL: https://issues.apache.org/jira/browse/FELIX-1461
> Project: Felix
> Issue Type: Bug
> Components: Maven Bundle Plugin
> Affects Versions: maven-bundle-plugin-1.4.3
> Reporter: Carsten Ziegeler
> Assignee: Stuart McCulloch
> Fix For: maven-bundle-plugin-2.0.1
>
>
> Sometimes I'm running several maven commands in parallel (different shells) and sometimes in these cases this ends in a corrupted repository.xml.
> It seems that in this case the repository.xml just contains this single line:
> <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
> which produces errors when it is tried to be read again.
> I guess that there are not that many people running maven in parallel but I think the repository.xml shouldn't be corrupted/erased in these cases either :)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (FELIX-1461) Corrupted repository.xml when maven
is run in parallel
Posted by "Stuart McCulloch (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-1461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stuart McCulloch reassigned FELIX-1461:
---------------------------------------
Assignee: Stuart McCulloch
> Corrupted repository.xml when maven is run in parallel
> ------------------------------------------------------
>
> Key: FELIX-1461
> URL: https://issues.apache.org/jira/browse/FELIX-1461
> Project: Felix
> Issue Type: Bug
> Components: Maven Bundle Plugin
> Affects Versions: maven-bundle-plugin-1.4.3
> Reporter: Carsten Ziegeler
> Assignee: Stuart McCulloch
> Fix For: maven-bundle-plugin-2.0.1
>
>
> Sometimes I'm running several maven commands in parallel (different shells) and sometimes in these cases this ends in a corrupted repository.xml.
> It seems that in this case the repository.xml just contains this single line:
> <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
> which produces errors when it is tried to be read again.
> I guess that there are not that many people running maven in parallel but I think the repository.xml shouldn't be corrupted/erased in these cases either :)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.