Menu

#201 wrapper.on_exit SHUTDOWN doesn't work

All
open
nobody
None
5
2024-04-12
2023-06-21
teapot418
No

Hello,

I used the configuration rules with these values:
wrapper.on_exit.2=SHUTDOWN
wrapper.on_exit.default=RESTART
wrapper.on_signal.default=RESTART

My application exited with exit code 2
(in wrapper.log : exit code posix process: 512 application(status/signal): 2/-1)
but application was restarted by the wrapper
(in wrapper.log : restart internal RUNNING controller killed restart handler)

I think that the reason of the bug is in WrappedJavaProcess.java, killedRestartHandler and restartHandler
There is this condition:

if ((allowRestart() && exitCodeRestart()
        && !exitCodeShutdown() && !exitCodeStop())
        ||
        (allowRestart() && exitSignalRestart()
                && !exitSignalShutdown() && !exitSignalStop()))
{
    restartInternal("controller killed restart handler");
}

In my case, the first part of the condition is false because of exit code 2
(allowRestart() && exitCodeRestart() && !exitCodeShutdown() && !exitCodeStop())

but the second part of the condition is true because of on_signal default rule
(allowRestart() && exitSignalRestart() && !exitSignalShutdown() && !exitSignalStop())

I think this condition should be like this

(allowRestart() && (exitCodeRestart()|| exitSignalRestart())
        && !exitCodeShutdown() && !exitCodeStop())
        && !exitSignalShutdown() && !exitSignalStop())

Regards
Monika

Discussion

  • rzo

    rzo - 2023-10-27

    thanks for pointing this out.
    will check this for release 13.11

    -- Ron

     
  • teapot418

    teapot418 - 2024-01-04

    hello,
    I have tried this in new release 13.11, but nothing changed, problem still continues

    Regards
    Monika

     
  • rzo

    rzo - 2024-01-08

    :((
    sorry. i will have to check this.

    -- Ron

     
  • rzo

    rzo - 2024-04-07

    release 13.12
    pls report if this issue is resolved or not.

     
  • teapot418

    teapot418 - 2024-04-12

    yes, Issue is solved, thank you.

     

Log in to post a comment.