Windows service startup blocks when starting SG allowing errors to be returned (#2284)
Windows service startup blocks when starting SG allowing errors to be returned (#2284)

* Changed service startup sequence so that Sync Gateway execution is now a blocking call to give a chance for startup errors to be returned to the Windows service.

It’s not clear that this will resolve all race conditions as the golang docs contain the following comment for program.Run()

`Start starts the specified command but does not wait for it to complete.

The Wait method will return the exit code and release associated resources once the command exits.`

It’s not clear how quickly Run() returns after starting Sync Gateway and whether a config validation error would sucessfully return an error from the Start() function.

* Service wrapper will panic whenever Sync Gateway Exits, it should never exit.

ceejatec/sync_gateway,tophatch/sync_gateway,ceejatec/sync_gateway,ceejatec/sync_gateway,couchbaselabs/sync_gateway,tophatch/sync_gateway,couchbaselabs/sync_gateway,couchbaselabs/sync_gateway,tophatch/sync_gateway,ceejatec/sync_gateway,tophatch/sync_gateway,couchbaselabs/sync_gateway