Alexandr  Denschikov
Alexandr Denschikov

Reputation: 338

SVN processes hang on Windows Server R2

I am trying to automate updating some data on my server. Windows Server 2008 R2. There are asp.net core 2.1 application that has code below

        var timeoutMs = 5000;
        var process = new Process();
        process.StartInfo.FileName = exePath;
        process.StartInfo.Arguments = arguments;            
        process.StartInfo.UseShellExecute = false;
        process.StartInfo.CreateNoWindow = true;
        process.Start();
        return process.WaitForExit(timeoutMs));

And here comes tricky part.

When I use exePath=svn.exe arguments=update "someWorkingFolderPath", process hangs and returns false after timeout (regularly update from cmd takes like couple of milliseconds)

Then repository corrupts and locks itself (because update does not exited correctly) and when I run 'svn update' on cmd it tells me to call svn cleanup.

!AND! When repository in this locked state, process with same argumentsdoesn't hang (because of same svn errot), until I run cleanup that breaks locks on working folder. Then it hangs again.

Calling 'svn log "folderPath"' also hangs process. Anytime

As you can see I am not redirecting any streams, I can run all this commands successfully manually from cmd. Application pool starts from same local administrator identity which I am using for cmd (not perfect, I know, but that's not a subject). I am using svn command line tools that comes with TortoiseSVN.

What may cause such problems?

Upvotes: 0

Views: 114

Answers (1)

Alexandr  Denschikov
Alexandr Denschikov

Reputation: 338

Days later I found out where the problem was and how to solve. Actually is kinda of simple mistake, but still it made me struggle, so just in case I post this answer

After running "svn auth" from my service, I learned that there was no credentials cache loaded. There is setting in Application Pool in IIS7 "Load user profile" and it was set to false in my situation. After setting it to true (and restarting the pool), svn loaded my credentials cache and all worked just fine.

I have no guess why svn does not time out on "svn update" without credentials cache after half an hour, if there were a proper error message, I would've sort it out faster

Upvotes: 1

Related Questions