Thank you Paul Allen for the quick reply.
I tried "autoClean", "forceClean" and "syncOnly". The behavior is he same.
How can I use the new logging feature you added?
The issue here is that the p4-pluging continue to do a loop of open and close p4 connections long after it finished its task. Can you please explain the need for this?
I fail to see the need for it. If there will be need to do another use of p4, then it can open the connection then.
I have jobs with duration of hours and days, and I keep see this slowness. You can see it yourself, in the pipeline code in steps to reproduce above, add long sleep between the p4 command and the "stage('run')". You will see that the plugin keep connecting to the p4 server and add long time to the build duration.
This is not some overhead but a big issue.
I apologize. I am not familiar with the internals of Jenkins so I do not understand the last paragraph you wrote.
Anyway, as you can see be the simple steps to reproduce above, when using the p4-plugin, it makes the whole run of the build to be much slower. I am talking about a constant delay of 1-10 seconds between each two command in the Jenkinsfile. We had this slowness for long time but did not know why. Now that we discovered the reason we discussed it today in the team and due to this we consider moving to git.