Starting a web bundle calls the init() method of the servlet, but stopping the bundle doesn't call the destroy() method, that appears to be called only when stopping the whole karaf container.
To replicate the problem:
install the attached jar
start the bundle :"init() called" is printed on the console
stop the bundle :"destroy() called" should be printed, but it is not
repeating steps 2 and 3 cause multiple call to only the init() method
stop karaf: "destroy() called" is printed on the console
Apache karaf 4.0.4
Looks like the servletHandler does give back a stop signal while the servlet hasn't been stopped.
fixed on master
cherry pick still needed