The ptree framework is lacking a standard method for a clean shutdown for applications that are run without a finite duration. This PR implements the shutdown RPC which causes the loop in lib.ptree.ptree.Manager.main to terminate and call the stop() method of the manager just as for the case of a finite duration of the app engine.
The stop() method implies that all running fibers are cancelled, which causes a flurry of messages
Error while running fiber: lib/ptree/inotify.lua:57: shutdown
to be logged. This is mainly a cosmetic issue but it clobbers the log and may confuse the user to believe there was a problem when there wasn't. The PR suppresses the printing of fiber-related messages if they contain the word "shutdown". A cleaner method to accomplish this could be desirable (i.e. terminate the fiber coroutine without throwing an error in case of a shutdown).
The ptree framework is lacking a standard method for a clean shutdown for applications that are run without a finite duration. This PR implements the
shutdown
RPC which causes the loop inlib.ptree.ptree.Manager.main
to terminate and call thestop()
method of the manager just as for the case of a finite duration of the app engine.The
stop()
method implies that all running fibers are cancelled, which causes a flurry of messagesto be logged. This is mainly a cosmetic issue but it clobbers the log and may confuse the user to believe there was a problem when there wasn't. The PR suppresses the printing of fiber-related messages if they contain the word "shutdown". A cleaner method to accomplish this could be desirable (i.e. terminate the fiber coroutine without throwing an error in case of a shutdown).