mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Resolve ALF-4844: Transfer Locks remain if a transfer error occurs on the client prior to the commit phase
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22623 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -660,14 +660,6 @@ public class TransferServiceImpl2 implements TransferService2
|
||||
}
|
||||
}
|
||||
|
||||
// notify transfer progress
|
||||
if (progress.getCurrentPosition() != pollPosition)
|
||||
{
|
||||
pollPosition = progress.getCurrentPosition();
|
||||
logger.debug("committing :" + pollPosition);
|
||||
eventProcessor.committing(progress.getEndPosition(), pollPosition);
|
||||
}
|
||||
|
||||
// check status
|
||||
if (progress.getStatus() == TransferProgress.Status.ERROR)
|
||||
{
|
||||
@@ -694,7 +686,16 @@ public class TransferServiceImpl2 implements TransferService2
|
||||
clientState = ClientTransferState.Finished;
|
||||
break;
|
||||
}
|
||||
else if (progress.getStatus() == TransferProgress.Status.COMPLETE)
|
||||
|
||||
// notify transfer progress
|
||||
if (progress.getCurrentPosition() != pollPosition)
|
||||
{
|
||||
pollPosition = progress.getCurrentPosition();
|
||||
logger.debug("committing :" + pollPosition);
|
||||
eventProcessor.committing(progress.getEndPosition(), pollPosition);
|
||||
}
|
||||
|
||||
if (progress.getStatus() == TransferProgress.Status.COMPLETE)
|
||||
{
|
||||
clientState = ClientTransferState.Finished;
|
||||
break;
|
||||
@@ -828,7 +829,17 @@ public class TransferServiceImpl2 implements TransferService2
|
||||
{
|
||||
logger.debug("Exception - unable to transfer", e);
|
||||
failureException = e;
|
||||
clientState = ClientTransferState.Finished;
|
||||
|
||||
if (transfer != null && (clientState == ClientTransferState.Begin || clientState == ClientTransferState.Prepare))
|
||||
{
|
||||
// we must first inform the target repository that a client failure has occurred to allow it to
|
||||
// clean up appropriately, too
|
||||
clientState = ClientTransferState.Cancel;
|
||||
}
|
||||
else
|
||||
{
|
||||
clientState = ClientTransferState.Finished;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user