Jump to content

Recommended Posts

Hi,

I've been trying to install a before-clientcheckin trigger and successfully did so until I added a couple of lines to my .bat file.

Since I've added a msbuild.exe command to the script the cm ci command is just hanging forever. So is the GUI if I try to checkin from there. The .bat file is running fine from cmd.exe. I also tried to read the log after setting the .conf file and it seems to get stuck on a cryptic:

2016-12-05 13:56:39,639 DEBUG Channel - Purging connection to plastic://pickledwarf-pc:8087/BranchHandler
2016-12-05 13:56:39,639 DEBUG Channel - Purging connection to plastic://pickledwarf-pc:8087/RepositoryHandler
2016-12-05 13:56:39,639 DEBUG Channel - Purging connection to plastic://pickledwarf-pc:8087/TriggerHandler

Anyone knows what this is about ?

Share this post


Link to post
Share on other sites

After 30 seconds of inactivity, network connections are closed.

 

If your bat never finishes, the checkin will wait forever. Chances are your trigger is not finishing as expected.

 

If you want the trigger to be async, then spawn a new process from it and make the trigger return as soon as possible.

Share this post


Link to post
Share on other sites

I figured it out.

Plastic doesn't support any ECHO during execution. msbuild.exe was outputting a whole load to stdout and for some reason that was causing the checkin to hang. I added >NUL after msbuild.exe and it solved the problem.

Share this post


Link to post
Share on other sites

Hello Lumz,

I'm sorry but I can't reproduce the issue, I use the following:

echo start
del "C:\Users\manu\Documents\Visual Studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\bin\Debug"\* /F/Q
del "C:\Users\manu\Documents\Visual Studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\obj\Debug"\* /F/Q
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe "C:\Users\manu\Documents\Visual Studio 2015\Projects\ConsoleApplication1\ConsoleApplication1.sln"
echo end

The checkin operation success and the solution gets compiled.Do you have more info to help us reproduce the issue?

  • Like 1

Share this post


Link to post
Share on other sites

Sorry to awaken this old thread, but this is still quite a problem!

I just spent a couple of hours trying to understand why my client-side trigger (before-setselector) would hang often but not always. This trigger called a .bat file that in turn called [cm status --ignored] without redirecting the output to >NUL.

You should be able to reproduce this issue using just a .bat file like this, called from a trigger:

FOR /L %%n IN (0,1,1000) DO  (
  ECHO "Just a lot of stupid text output"
)

For me, this .bat file hangs the trigger, but it no longer does if I decrease the loop number from 1000 to 100. This was tested on the very latest Plastic version (8.0.16.3937).

Share this post


Link to post
Share on other sites

Hi,

I'm afraid I cannot reproduce the issue using the same trigger (even increasing the value from 1000 to 10000). Are you just manually running the "cm status --ignored" command?

Do you have multiple ignored items in your workspace?

Regards,

Carlos.

Share this post


Link to post
Share on other sites

Yes we have lots of ignored items, which is how I discovered this problem in the first place. But the [cm status --ignored] command is beside the point, since the issue appears even with a simple echo:ing for-loop. I'm not sure I was clear enough on how to reproduce the issue, so here's a more complete step-by-step description:

Step1 - Create file echo_trigger.bat in workspace root:

@ECHO OFF
FOR /L %%n IN (0,1,1000) DO  (ECHO "Just a lot of stupid text output")

Step 2 - Verify that the echo_trigger.bat script outputs lots of lines when run.

Step 3 - Setup client-side trigger:

> cm trigger create before-setselector "echoing trigger" "@WKSPACE_PATH\echo_trigger.bat"

Step 4 - Run the trigger:

> cm switch br:/main

NOTE: The switch command in step 4 does not terminate, seemingly since the trigger chokes on the amount of output to stdout from the script. (But if I decrease the loop limit from 1000 to 100 and re-run the switch command, it terminates fine.)

Also, if you are really unable to reproduce the hung trigger - please make sure you are actually hitting the trigger, by adding a PAUSE command at the end of the .bat file. Then it should hang the trigger regardless...

Best regards,
Göran W.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...