bgsave: add unit testing hooks for after bgsave fork & pre exit.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com> Change-Id: I35a2ec185762138dc85db39df3e7644c60acfddcpull/8782/head
parent
5dbe4fe02f
commit
2d018d38a5
|
@ -524,6 +524,10 @@ public:
|
|||
/// Post fork hook - just before we init the child kit
|
||||
virtual void postFork();
|
||||
|
||||
/// Called just after and before bg save process events
|
||||
virtual void postBackgroundSaveFork() {}
|
||||
virtual void preBackgroundSaveExit() {}
|
||||
|
||||
/// Kit got a message
|
||||
virtual bool filterKitMessage(WebSocketHandler *, std::string &/* message */ )
|
||||
{
|
||||
|
|
|
@ -1425,6 +1425,8 @@ bool Document::forkToSave(const std::function<void()> &childSave, int viewId)
|
|||
childSocket.reset();
|
||||
// now we just have a single socket to our parent
|
||||
|
||||
UnitKit::get().postBackgroundSaveFork();
|
||||
|
||||
// Hard drop our previous connections to coolwsd and shared wakeups.x
|
||||
KitSocketPoll::cleanupChildProcess();
|
||||
|
||||
|
|
|
@ -209,6 +209,7 @@ void BgSaveChildWebSocketHandler::handleMessage(const std::vector<char>& data)
|
|||
void BgSaveChildWebSocketHandler::onDisconnect()
|
||||
{
|
||||
LOG_TRC("Disconnected background web socket to parent kit");
|
||||
UnitKit::get().preBackgroundSaveExit();
|
||||
Util::forcedExit(EX_OK);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue