[ 
https://issues.jenkins-ci.org/browse/JENKINS-9104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=162154#comment-162154
 ] 

Daniel Weber commented on JENKINS-9104:
---------------------------------------

We adopted Neil's workaround, but found a small issue. The problem is that 
checking if 
mspdbsrv is running does not reset its timeout. Consider this scenario where 
the compiler 
is first used 5 min after build start:

   00:00 job A starts -> mspdbsrv not yet running -> mspdbsrv is started with 
the changed BUILD_ID
   01:00 job A finishes (mspdbsrv default timeout of 10 min starts here)
   01:07 job B starts -> mspdbsrv still running   -> mspdbsrv is not restarted
   01:10 mspdbsrv timeout elapses, shuts down 
   01:12 job B tries to use mspdbsrv for the first time. As mspdbsrv is not 
running, it starts a new 
         instance with unchanged BUILD_ID, which is what we wanted to avoid in 
the first place.

I suggest to change the build script as follows

  start mspdbsrv -start -spawn -shutdowntime 2147483647

This sets the shutdown time to the max value of 2^31-1. This timeout (~68 
years) should be long enough :)

                
> Visual studio builds started by Jenkins fail with "Fatal error C1090" because 
> mspdbsrv.exe gets killed
> ------------------------------------------------------------------------------------------------------
>
>                 Key: JENKINS-9104
>                 URL: https://issues.jenkins-ci.org/browse/JENKINS-9104
>             Project: Jenkins
>          Issue Type: Bug
>          Components: core
>    Affects Versions: current
>         Environment: Windows XP, using MSBuild or devenv.exe to build MS 
> Visual Studio Projects
>            Reporter: Christoph VogtlÃĪnder
>            Priority: Minor
>
> I run into errors when using a customized build system which uses Visual 
> Studio's devenv.exe under the hood to compile VisualStudio 2005 projects 
> (with VC++ compiler). When starting two parallel builds with Jenkins (on 
> different code base) the second job will always fail with "Fatal error C1090: 
> PDB API call failed, error code '23' : '(" in exactly the same second the 
> first job finishes processing. Running both jobs outside Jenkins does not 
> produce the error.
> This has also been reported for builds executed by MSBuild on the Jenkins 
> user mailing list [1].
> I analysed this issue thoroughly and can track the problem down to the usage 
> of mspdbsrv.exe. This program is automatically spawned when building a 
> VisualStudio project. All Visual Studio instances normally share one common 
> pdb-server which shutdown itself after a idle period (standard is 10 
> minutes). "It ensures access to .pdb files is properly serialized in parallel 
> builds when multiple instances of the compiler try to access the same .pdb 
> file" [2].
> I assume that Jenkins does a clean up of its build environment when a 
> automatically started job finishes (like as described at 
> http://wiki.jenkins-ci.org/display/JENKINS/Aborting+a+build). I checked 
> mspbsrv.exe with ProcessExplorer and the process indeed has a variable 
> JENKINS_COOKIE/HUDSON_COOKIE set in its environment if started through 
> Jenkins. Killing mspdbsrv.exe while projects are still connected will break 
> compilation. 
> Jenkins mustn't kill mspdbsrv.exe to be able to build more than one Visual 
> Studio project at the same time.
> --
> [1] 
> http://jenkins.361315.n4.nabble.com/MSBuild-fatal-errors-when-build-triggered-by-timer-td385181.html
> [2] 
> http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/b1d1bceb-06b6-47ef-a0ea-23ea752e0c4f/

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to