sebbASF commented on code in PR #238: URL: https://github.com/apache/commons-daemon/pull/238#discussion_r1944335695
########## src/native/windows/apps/prunsrv/prunsrv.c: ########## @@ -952,9 +953,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 15 seconds for the service logic */ Review Comment: Is that the reason for the *2 below? I assume so, but I could be wrong. ########## src/native/windows/apps/prunsrv/prunsrv.c: ########## @@ -952,9 +953,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 15 seconds for the service logic */ int i; - for (i = 0; i < timeout; i++) { + for (i = 0; i < (timeout*2+15); i++) { + /* apxServiceCheckStop waits 1000 ms */ Review Comment: The magic number 15 should have a define. -- 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