Created On:  12 April 2012

Problem:

When restarting the Star Team Service the service fails and the log ontains the following exceptions:

Exception thrown from CStBlockingSocket::Bind - ::bind: Class = StSocketException, Code = 0(00000000)
 Msg = Socket error. Code: 10048
  [SocketErrorCode] = 10048
  [Error Description] = Only one usage of each socket address (protocol/network address/port) is normally permitted.
 
Exception handled at CStBlockingSocket::Listen: Class = StSocketException, Code = 0(00000000)
 Msg = Socket error. Code: 10048
  [SocketErrorCode] = 10048

  [Error Description] = Only one usage of each socket address (protocol/network address/port) is normally permitted.
Exception handled at CStServer::Run: Class = StSocketException, Code = 2(0x00000002)
 Msg = Unable to start listening for connections. The IP address and endpoint combination may already be in use.

This error ocurs even though no other application is using socket. The Star Team Service is configured to retry on first failure and the second restart attempt works successfully.

Resolution:

When the Star Team Service shuts down there is a short delay in releasing the socket assigned to StarTeam.  During the first start up attempt of the Service, the Operating System still has yet to release the socket, causing Star Team to believe socket is already in use.  By the time the first Service start up cycle completes (and fails) the socket will have been released, this is why the second attempt will succeed. 

Not every user will experience this issue.  It is determined by the speed of the Star Team Server restarts and this will vary for all customers.  To alleviate this issue we reccomened implementing a delay in the Service.  This can be done in two ways

1. In your Star Team Service ‘Properties’ startup type select ‘Automatic (delayed start)’.

2. In registry, under

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\]

add a DWORD value called 'DelayedAutoStart' and set its value to 1. 

If modifying the Windows Registry, please ensure you are confident in working within this area of the Operating System as errors made can have a detrimental effect on your Operating System.

Incident #2567288