-
Bug
-
Resolution: Unresolved
-
Major
-
None
We had setup our sync to use
AutoCleanImpl
As the sync method for our project but noticed that when we stopped a job that was in the process of reconcile the job in Jenkins would stop normally but the agent would carry on with the reconcile.
Here is a stack trace obtained by monitoring an agent that was effectively idle on which we had just cancelled a job during a reconcile :
pool-1-thread-146 for JNLP4-connect connection to jenkis-server-url/10.144.6.28:20555 id=17503
java.io.WinNTFileSystem.list(Native Method)
java.io.File.list(File.java:1134)
java.io.File.listFiles(File.java:1219)
com.perforce.p4java.impl.mapbased.rpc.func.client.ClientSystemFileMatchCommands.traverseDirs(ClientSystemFileMatchCommands.java:726)
com.perforce.p4java.impl.mapbased.rpc.func.client.ClientSystemFileMatchCommands.traverseDirs(ClientSystemFileMatchCommands.java:790)
com.perforce.p4java.impl.mapbased.rpc.func.client.ClientSystemFileMatchCommands.traverseDirs(ClientSystemFileMatchCommands.java:790)
com.perforce.p4java.impl.mapbased.rpc.func.client.ClientSystemFileMatchCommands.traverseDirs(ClientSystemFileMatchCommands.java:790)
com.perforce.p4java.impl.mapbased.rpc.func.client.ClientSystemFileMatchCommands.traverseDirs(ClientSystemFileMatchCommands.java:790)
com.perforce.p4java.impl.mapbased.rpc.func.client.ClientSystemFileMatchCommands.traverseDirs(ClientSystemFileMatchCommands.java:790)
com.perforce.p4java.impl.mapbased.rpc.func.client.ClientSystemFileMatchCommands.reconcileAdd(ClientSystemFileMatchCommands.java:588)
com.perforce.p4java.impl.mapbased.rpc.func.client.ClientFunctionDispatcher.dispatch(ClientFunctionDispatcher.java:220)
com.perforce.p4java.impl.mapbased.rpc.packet.RpcPacketDispatcher.dispatch(RpcPacketDispatcher.java:160)
com.perforce.p4java.impl.mapbased.rpc.OneShotServerImpl.execMapCmdList(OneShotServerImpl.java:363)
com.perforce.p4java.impl.mapbased.rpc.OneShotServerImpl.execStreamingMapCommand(OneShotServerImpl.java:428)
com.perforce.p4java.impl.mapbased.client.Client.reconcileFiles(Client.java:1806)
org.jenkinsci.plugins.p4.client.ClientHelper.tidyClean(ClientHelper.java:570)
org.jenkinsci.plugins.p4.client.ClientHelper.tidyAutoCleanImpl(ClientHelper.java:492)
org.jenkinsci.plugins.p4.client.ClientHelper.tidyWorkspace(ClientHelper.java:436)
org.jenkinsci.plugins.p4.tasks.CheckoutTask.task(CheckoutTask.java:163)
org.jenkinsci.plugins.p4.tasks.AbstractTask.retryTask(AbstractTask.java:202)
org.jenkinsci.plugins.p4.tasks.AbstractTask.tryTask(AbstractTask.java:185)
org.jenkinsci.plugins.p4.tasks.CheckoutTask.invoke(CheckoutTask.java:157)
org.jenkinsci.plugins.p4.tasks.CheckoutTask.invoke(CheckoutTask.java:32)
hudson.FilePath$FileCallableWrapper.call(FilePath.java:3052)
hudson.remoting.UserRequest.perform(UserRequest.java:212)
hudson.remoting.UserRequest.perform(UserRequest.java:54)
hudson.remoting.Request$2.run(Request.java:369)
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
java.util.concurrent.FutureTask.run(FutureTask.java:264)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:93)
hudson.remoting.Engine$1$$Lambda$68/0x00000008001cd840.run(Unknown Source)
java.lang.Thread.run(Thread.java:834)**
Starting a new job on this agent would yield conflict as the agent would have file handle on some of the files while the next job would also attempt to perform a reconcile.
ERROR: P4: Task Exception: com.perforce.p4java.exception.P4JavaException: com.perforce.p4java.exception.P4JavaException: hudson.AbortException: P4JAVA: Error(s):11:41:32 operating system will not allow deletion of file e:\jwrk\stg\workspace\XXXXX-Win64-Mono\Assets_Game\Environments\Architecture\Mesh\Keyhole_Tower_01\Base\Floor_Base_Interior_01\.Sources\Floor_Base_Interior_01.ZTL on client.
when looking for this handle on the node we could find that the agent process itself was holding on to that file.
Lastly we did notice that some tmp files were left in the source tree indicative of a perforce operation that did not clean itself properly.
We worked around the problem by not doing reconciles anymore at all, we are force syncing systematically. Which is faster anyways for large projects.