CVS checkout failed patch
Steve Magoun <[email protected]> Sun, 27 Apr 2003 18:02:49 -0400
| Newsgroups | gmane.comp.java.anthill.devel,gmane.comp.java.anthill |
|---|---|
| Message-ID | <[email protected]> |
Every once in awhile a CVS will fail with the error "cvs [checkout
aborted]: end of file from server (consult above messages if any)."
This is a random, intermittent problem with CVS itself; it doesn't
signify a configuration error in Anthill or a broken build. Even so,
Anthill reports it as a failed build. I wrote a patch to
CVSRepositoryAdapter that works around the problem by retrying the
checkout; I've been running it for a couple of weeks, and it seems to
solve the problem. I filed the problem (and patch) as bug 465.
Enjoy,
Steve
Add the following to CVSRepositoryAdapter to fix the problem:
private static final String CVS_TRAPPED_ERROR =
"cvs [checkout aborted]: end of file from server (consult
above
messages if any)";
/**
* override getWorkingProjectCopy() in ProfileRepositoryAdapter to
* handle an intermittent CVS bug. Every once in awhile the CVS
checkout
* task will fail for some reason. It's a very intermittent problem,
* and doesn't signify a configuration error or build problem. If it
* happens, we simply retry the checkout.
*/
public void getWorkingProjectCopy() throws RepositoryException {
try {
super.getWorkingProjectCopy();
} catch (RepositoryException e) {
log.info("RepositoryException in checkout. message: " +
e.getMessage());
if (e.getMessage().indexOf(CVS_TRAPPED_ERROR) > -1) {
log.info("CVS returned checkout aborted error. Trying
again");
super.getWorkingProjectCopy();
}
}
}