jfclere commented on code in PR #238: URL: https://github.com/apache/commons-daemon/pull/238#discussion_r1998511413
########## src/native/windows/apps/prunsrv/prunsrv.c: ########## @@ -952,9 +955,16 @@ static BOOL docmdStopService(LPAPXCMDLINE lpCmdline) if (!rv) { /* Wait for the timeout if any */ int timeout = SO_STOPTIMEOUT; + if (timeout == 0) { + /* waiting for ever doesn't look OK here */ + timeout = ONE_MINUTE_SEC; + } if (timeout) { + /* the SO_STOPTIMEOUT applies to the stop command and to the time service needs to stop */ + /* We also add TIMEFORSERVICEMANAGER seconds for the service logic */ int i; - for (i = 0; i < timeout; i++) { + for (i = 0; i < (timeout*2+TIMEFORSERVICEMANAGER); i++) { Review Comment: Agreed that makes more sense. Here we just need to wait for timeout, the service is another process where we need maximumFinishTime and currentTime. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org