Commit graph

41 commits

Author SHA1 Message Date
Ashod Nakashian
5b639c3a2d loolwsd: use log settings from the config XML
Change-Id: I0384d97b5411d3ff537b344e67f166daa65630c1
Reviewed-on: https://gerrit.libreoffice.org/27951
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-08-08 03:46:06 +00:00
Pranav Kant
b83ac269fa loolwsd: Send LOKit version information to clients
Send as a response to 'loolclient' message received from the
client

Change-Id: I3d33f9fd087489aa9bf5a94f591ab04e208cbf13
2016-06-21 00:30:36 +05:30
Pranav Kant
e271995ed2 loolwsd: Restructure version information functions
... so that version information can be sent to clients.

Change-Id: Icc90f31fabb501f816ff1dca0c618a73660c88bc
2016-06-21 00:29:41 +05:30
Miklos Vajna
afb6a7ebb0 Util: turn TerminationFlag into an std::atomic<bool>
Running unit-fonts under helgrind points out missing synchronization
there.
2016-06-15 15:31:41 +02:00
Ashod Nakashian
fae850189d loolwsd: include cleanup and organization
A source file (.cpp) must include its own header first.
This insures that the header is self-contained and
doesn't depend on arbitrary (and accidental) includes
before it to compile.

Furthermore, system headers should go next, followed by
C then C++ headers, then libraries (Poco, etc) and, finally,
project headers come last.

This makes sure that headers and included in the same dependency
order to avoid side-effects. For example, Poco should never rely on
anything from our project in the same way that a C header should
never rely on anything in C++, Poco, or project headers.

Also, includes ought to be sorted where possible, to improve
readability and avoid accidental duplicates (of which there
were a few).

Change-Id: I62cc1343e4a091d69195e37ed659dba20cfcb1ef
Reviewed-on: https://gerrit.libreoffice.org/25262
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-21 15:52:54 +00:00
Ashod Nakashian
6ce9868a9c loolwsd: more frequent zombie reaping in forkit
Change-Id: I10d859880cfd933c38572852f506eedf603e8fad
Reviewed-on: https://gerrit.libreoffice.org/25232
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-21 03:16:56 +00:00
Miklos Vajna
c2fc95ac23 Drop unused using declarations
Change-Id: Iee778833781c6f00c1fb0b8fc1975acfe4fb0cd9
2016-05-10 09:14:22 +02:00
Ashod Nakashian
d2f4a516a6 loolwsd: spawn ForKit process after initializing server
WSD server must be up and listening to incoming
connections before firing up ForKit and spawning
children.

Having the order reversed caused tests to fail
randomly when WSD was slow to listen to incoming
connections from children already initialized.

Change-Id: I4eaf4a658c65da024101efc096c39222ebfa3c00
Reviewed-on: https://gerrit.libreoffice.org/24745
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-08 04:31:44 +00:00
Jan Holesovsky
191ee00f2c Run the tests on ports that do not conflict with a 'normal' loolwsd.
For the moment, it will allow running 'make check' that does not conflict with
an already running loolwsd (eg. from 'make run').  Later we can consider
running more tests in parallel.
2016-05-04 13:39:32 +02:00
Tor Lillqvist
d012075dc8 Sanity check 2016-04-18 16:40:28 +03:00
Tor Lillqvist
a08b2a0e0b Just use "/" instead of Poco::Path::separator() 2016-04-18 15:34:34 +03:00
Tor Lillqvist
311a748d45 Clean up jails of exited loolkit processes sooner
In loolforkit, whenever we have forked a new loolkit, also check if
any previously forked children have exited. Remove the jails of
those. (The loolkit process itself does not even try to remove all of
its jail, see 3aadd910c6e32c0e557671effa5a4c606cd6e8bf.)

In order to be able to notice exited child processes in loolforkit, we
no longer can set the action for SIGCHLD to SIG_IGN. That means that
exiting loolkit processes will be in the zombie state until loolforkit
picks up their exit status. As loolforkit does this check only in
connection with forking a new child, zombie loolkit processes will
hang around for some time, until the next loolkit process is
forked. Not sure if this is a problem.

countLoolKitProcesses() in httpwstest now needs to skip zombies.

Loolwsd still takes care of removing whatever jails are left when it
finishes.
2016-04-18 14:30:09 +03:00
Miklos Vajna
0f82a3a6ae loolwsd: fix -Werror,-Wshadow
Change-Id: I33095de03e5f3df3ed8919121f6a078f80c26ae9
2016-04-18 08:41:19 +02:00
Ashod Nakashian
7399f82b4e loolwsd: std::exit -> std::_Exit in forkit
Change-Id: I68af331440d95811f1d50c95de470350c0b6a4a3
Reviewed-on: https://gerrit.libreoffice.org/24179
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-18 03:33:12 +00:00
Ashod Nakashian
a000a1e274 loolwsd: forkit exits without cleanup to avoid LO Core assertions
Change-Id: Ic9033b7d33f2ef114615950f01eab5904faa2ca7
Reviewed-on: https://gerrit.libreoffice.org/24165
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-17 16:12:49 +00:00
Ashod Nakashian
882ffafb16 loolwsd: simplified ChildDispatcher
Change-Id: I5b61678a01f4491ca06a25dd969f7538b4c8445d
Reviewed-on: https://gerrit.libreoffice.org/24164
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-17 16:12:30 +00:00
Michael Meeks
6388298a04 Attempt at a --nocaps argument to run with no caps, ie. under valgrind. 2016-04-16 20:47:55 +01:00
Michael Meeks
a49f642801 Tolerate --version, and add git hash version, print on default start.
Should help diagnosing issues - to have this in our logs.
2016-04-15 15:07:24 +01:00
Michael Meeks
688d1ab6e6 Remove confusing ChildProcessSession include on LOOLWSD.
Move the ClientPortNumber into both Kit and WSD.
2016-04-14 18:58:18 +01:00
Michael Meeks
35b27b352c Initial font unit test. 2016-04-14 09:34:52 +01:00
Michael Meeks
25a092d7de Add memory accounting metric to UnitPrefork.
Also add hooks to allow custom LOK <-> WSD message for this test.
2016-04-12 21:58:27 +01:00
Michael Meeks
6a990dfb61 Security bits and test cleanup.
Enforce user being 'lool' for setcap binaries loolmount and loolforkit.

Add warnings if configured without --enable-debug.

Developers should pass --enable-debug to configure.
2016-04-12 17:13:56 +01:00
Tor Lillqvist
5c6e209567 Log creation and opening of fifos in more detail 2016-04-12 17:49:20 +03:00
Tor Lillqvist
9086f378d8 Pedantry 2016-04-12 14:48:26 +03:00
Tor Lillqvist
8dcd7d22e4 Remove a few more more leftovers from the "broker" terminology 2016-04-12 14:24:47 +03:00
Ashod Nakashian
213888c45c loolwsd: logging and remove unused vars
Change-Id: Iff4cf5284a959caf84ce6ca5072623b6f95315df
Reviewed-on: https://gerrit.libreoffice.org/23949
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-10 03:33:38 +00:00
Ashod Nakashian
6a907a7a7f loolwsd: preFork is done once by ForKit already and sanity check count
Change-Id: I8ee843e35198ef88bdf191c11a2a738fae6e6c30
Reviewed-on: https://gerrit.libreoffice.org/23947
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-10 03:28:25 +00:00
Michael Meeks
5b8f49423d More kit unit testing tentacles. 2016-04-09 18:29:20 +01:00
Michael Meeks
b308792801 Add infrastructure to inject test pieces into loolforkit. 2016-04-09 18:17:12 +01:00
Tor Lillqvist
c08d35dd15 Add comment 2016-04-08 13:12:21 +03:00
Tor Lillqvist
48bc23f3ce Drop unnecessary variable 2016-04-08 13:09:06 +03:00
Tor Lillqvist
ca4d8ea451 ChildCounter is never incremented or decremented 2016-04-08 13:07:33 +03:00
Tor Lillqvist
e026a7073b We don't need _exit here
This is called in the parent loolforkit process. It's in the loolkit
processes that we want to do the blunt exits, I assume.
2016-04-08 11:43:33 +03:00
Tor Lillqvist
84cd6bbceb Try to be more consistent in terminology
The "Broker" process is called "ForKit" now. The only things called
"broker" now are the DocumentBroker objects in the WSD process.
2016-04-07 11:53:44 +03:00
Tor Lillqvist
d28354c6a6 Bin unused variables 2016-04-07 11:53:44 +03:00
Tor Lillqvist
acc59a2ea5 Make error messages more consistent and use Log::syserror() in more places
A call to Log::error() should be enough to indicate that it is an
error. We don't need to prefix the message with the string "Error: "
in some cases but not others. (If we do want such a prefix for all
errors, surely then we should add it in the actual Log::error()
function.)

Also, change some more Log::error() calls to Log::syserror() where
appropriate.
2016-04-07 11:53:44 +03:00
Tor Lillqvist
ec604599f1 Introduce separate Log::syserror() function for logging actual syscall errors
Much better than assuming that errno would be relevant at all
Log::error() calls (or alternatively, having to remember to append a
false parameter to the Log::error() call, which had not been done a
single time anyway.)

Call log::syserror() right after a system call has returned an
error. Don't call it otherwise.
2016-04-07 10:36:38 +03:00
Ashod Nakashian
0aa60f8745 loolwsd: ignore SIGCHLD and auto-reap zombies
Change-Id: Ia927d4d01c38a8929a47fb8aa014f0ed5896f8ed
Reviewed-on: https://gerrit.libreoffice.org/23859
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-06 13:52:25 +00:00
Ashod Nakashian
5e41763386 loolwsd: disconnect WS before killing/abandoning child
Change-Id: Iff0ac1b57ce9e0fe61871fad9a499d370c2c9294
Reviewed-on: https://gerrit.libreoffice.org/23858
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-06 13:52:05 +00:00
Michael Meeks
2cdc96c76d Close inherited WSD socket after fork.
Leave stderr/stdout etc. though.
2016-04-05 14:51:22 +01:00
Michael Meeks
6ec2e8ca68 Rename loolbroker to loolforkit - and split the child to LOOLKit.
Move ChildProcessSession to shared_source and fix the static
ClientPortNumber issue.
2016-04-05 14:45:46 +01:00