Jump to content


swarm-trigger.pl -t shelvedel on windows creates new child process every second

swarm trigger perl windows

  • Please log in to reply
11 replies to this topic

#1 vadimg

vadimg

    Newbie

  • Members
  • Pip
  • 9 posts
  • LocationSilicon Valley, CA

Posted 26 August 2019 - 07:26 PM

Hello everyone!

We run perforce server on windows (2018.2) and swarm on linux (2018.3). Every time any p4 user deletes file(s) from shelve it triggers (as expected) "swarm-trigger.pl -t shelvedel ..." which starts new child perl process with extra -z parameter every second until multiple perl processes eat up to 100% CPU then start slowly dying.
Any ideas what is wrong?

thank you!
~vadim

#2 kschmidtgasket

kschmidtgasket

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 19 February 2020 - 11:51 PM

Is there any update to this issue? I am experiencing the same thing with P4 on windows (server 2016) (2018.1) and Swarm on linux (2019.3)

#3 P4Reg

P4Reg

    Advanced Member

  • Staff Moderators
  • 105 posts

Posted 24 February 2020 - 05:25 PM

In the swarm.shelvedel trigger definition, can you try hard coding the server version in the -s argument (whatever "p4 info" reports for server version, without a patch so for example like "2018.1"), and also putting the -d argument at the end

For example (modifying for your own trigger script and perl.exe locations):

swarm.shelvedel shelve-delete //... "%quote%C:\Strawberry\perl\bin\perl.exe%quote% %quote%C:\P4Triggers\Swarm\triggers\swarm-trigger.pl%quote% -t shelvedel -v %change% -w %client% -u %user% -s 2018.1 -a %quote%%argsQuoted%%quote% -d %quote%%clientcwd%%quote%"


In certain cases it looks like the -d arg that should contain just the clientcwd can slurp up all the rest of the args and leave the -s (server version) empty (as well as -a argsQuoted).

#4 vadimg

vadimg

    Newbie

  • Members
  • Pip
  • 9 posts
  • LocationSilicon Valley, CA

Posted 24 February 2020 - 11:51 PM

I just hard-coded server version (-s 2018.2) and all seems to be working fine now. I didn't move -d argument at the end.
thank you!

#5 kschmidtgasket

kschmidtgasket

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 25 February 2020 - 11:48 PM

Thank you - we fixed this by removing the server version parameter in the trigger line, and the server version parsing in the swarm trigger script.

#6 P4Reg

P4Reg

    Advanced Member

  • Staff Moderators
  • 105 posts

Posted 26 February 2020 - 09:59 AM

As already mentioned above, what seems to happen in rare cases (so far we've only seen it with Strawberry Perl) is that the -d arg that should contain just the clientcwd was slurping up all the rest of the args and leaving the -s (server version) empty (as well as -a argsQuoted). Hence the suggestion to put -d at the end so it couldn't get greedy with other args.

I noticed in one case the "p4 shelve -d" command  the -d clientcwd argument was reported as being done from the A: drive and that was appearing with a "stray" unmatched double quote in the -d output right after the ":" char;

d = "a:" -a -df,-c,1191577 -s 2018.1"

I don't have a sensible explanation why it's being returned like that (some strangeness in the args pattern matching with a ":" at the end of the path?),  I'm guessing that could be causing some odd parsing behaviour in the args array

#7 kschmidtgasket

kschmidtgasket

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 26 February 2020 - 06:14 PM

We have -a as the last parameter and the trigger is working as expected (forgot to mention that yes we are using Strawberry Perl as well)

#8 vadimg

vadimg

    Newbie

  • Members
  • Pip
  • 9 posts
  • LocationSilicon Valley, CA

Posted 26 February 2020 - 06:44 PM

We are using Strawberry Perl as well.
It looks like the order of arguments is not important if server version is hard-coded. Moving -d argument at the end didn't help (kept -s %quote%%serverVersion%%quote%).

#9 P4Reg

P4Reg

    Advanced Member

  • Staff Moderators
  • 105 posts

Posted 27 February 2020 - 12:04 PM

I discovered there has been a bug logged recently, it turns out the shelvedel trigger can fail with the server version error  when CWD=C:\ (or another drive root) and attempting to delete a shelved file. So it's very specific to Windows servers and being in a drive root when running the shelve delete.

#10 kschmidtgasket

kschmidtgasket

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 27 February 2020 - 06:39 PM

In our case our CWD isn't in a drive root.

#11 P4Reg

P4Reg

    Advanced Member

  • Staff Moderators
  • 105 posts

Posted 28 February 2020 - 10:36 AM

Do you have any spaces in the trigger path

#12 kschmidtgasket

kschmidtgasket

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 28 February 2020 - 08:09 PM

This is our current trigger path:
swarm.shelvedel shelve-delete //... "%quote%C:\Strawberry\perl\bin\perl.exe%quote% %quote%D:\swarmPerforce\triggers\swarm-trigger.pl%quote% -c %quote%D:\swarmPerforce\triggers\swarm-trigger.conf%quote% -t shelvedel  -v %change% -w %client% -u %user% -d %quote%%clientcwd%%quote% -a %quote%%argsQuoted%%quote%"

It is missing the server version param, because it seemed that anything after it would not read in correctly. The "-z" that would be added wouldn't be read, so swarm-trigger.pl would continue to stop and spawn a child process with an additional "-z" indefinitely. There were definitely spaces in the result of %quote%%serverVersion%%quote%" but that seemed to be as intended. Removing the version checking since we're running P4 2018.1 fixed everything.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users