Commit graph

36 commits

Author SHA1 Message Date
Tor Lillqvist
4eaffc74f0 Log the exit status of a child process, or the signal that killed it 2015-04-24 13:14:57 +03:00
Tor Lillqvist
91d0e9329c Fix the waitpid() use
We don't want to use WNOHANG, not sure where I got that idea from. That leads
to busy looping. The loop is in a thread of its own, so it is fine to just
wait ("hang") for some child to die.
2015-04-24 11:26:41 +03:00
Tor Lillqvist
4f9739854a s/localhost/127.0.0.1/
Makes the chrooted child process more reliable on diverse distros/versions.
Let's use 127.0.0.1 in all cases for consistency.
2015-04-23 18:52:19 +03:00
Jan Holesovsky
8be550056b SLEEPFORDEBUGGER is still useful for debugging, re-introduce that.
This reverts commit af3545b897.
2015-04-23 17:29:56 +02:00
Tor Lillqvist
b49d4d8885 Use shared_ptr and weak_ptr in attempt to make the pointer dance more robust
It was obviously very wrong to use both a unique_ptr to the
MasterProcessSession in WebSocketRequestHandler::handleRequest(), and then a
bare pointers to the peer object in the MasterProcessSession object. We got
crashes here and there related to the destructors.

Let's see if we can manage without mutexes.
2015-04-22 21:50:17 +03:00
Tor Lillqvist
59bd08299c _childId is used only in MasterProcessSession 2015-04-22 21:49:53 +03:00
Tor Lillqvist
a0292468da Catch (and ignore) Poco::IOException in a couple of places
There probably are more places where I should catch those and act
appropriately. At least in these places, where the websocket connection is
already closed, or being closed, anyway, the right thing to do is just to
ignore exceptions, which are generated from attempts to write to an already
closed Poco WebSocket, for instance.
2015-04-22 21:48:14 +03:00
Tor Lillqvist
fcea475bb5 Use separate classes derived from LOOLSession for parent and child processes
Work in progress. Does not work properly yet.
2015-04-22 21:48:04 +03:00
Tor Lillqvist
faec3cd961 We indeed don't need the signalfd stuff, I hope
As such it worked, but if we can manage with simpler code, no need to use it.
2015-04-22 21:47:20 +03:00
Tor Lillqvist
02f12402bf This was what I meant
But actually I wonder why I thought I would need signalfd at all; wouldn't it
be enough to just loop in the undertaker thread, calling waitpid(), as long as
there are child processes? I'll try after this commit.

(Besides, I now notice that when I client disconnects, we don't close the
websocket to the child process, so it never goes away. Will fix that.)
2015-04-22 21:46:56 +03:00
Tor Lillqvist
39b6258aa9 Clean up the jail after the prisoner has died 2015-04-22 21:46:33 +03:00
Tor Lillqvist
291710cc1c Typo 2015-04-22 21:46:23 +03:00
Tor Lillqvist
af3545b897 No need for the SLEEPFORDEBUGGER thing any more
As the child processes are pre-spawned and just hang around waiting, there is
ample time to attach one in a debugger in a controlled debugging scenario
anyway.
2015-04-22 21:46:04 +03:00
Tor Lillqvist
1b32383875 Improve help messages 2015-04-22 21:45:47 +03:00
Tor Lillqvist
b760359bda Terminology change: s/fork/spawn
We aren't doing any fork-but-not-exec trick anyway, just a straightforward
start of a child process.
2015-04-22 21:45:31 +03:00
Tor Lillqvist
3abb6d0307 Now the chroot etc re-work is getting closer to working
Works now for the trivial 'connect' test program. Still need to add
pre-spawning of a new child process as soon as an existing one from the pool
has been taking into use. And need to test with the actual JS client.
2015-04-22 21:44:17 +03:00
Tor Lillqvist
652580a761 Another intermediate commit, code still in a non-working state 2015-04-22 21:43:44 +03:00
Tor Lillqvist
0a60ea9dcc Bump Emacs fill-column to 100
The default 70 is so last century.
2015-04-22 21:43:11 +03:00
Tor Lillqvist
7f50f06bf4 Add some comments 2015-04-22 21:42:47 +03:00
Tor Lillqvist
4c7b5a39e3 master LibreOffice no longer does the "restart required" thing when used from LOKit 2015-04-22 21:42:28 +03:00
Tor Lillqvist
f9d93ea57c Work in progress: "pre-forking", chroot, etc. Non-working state
Lots of changes to the server code, LOOLWSD and LOOLSession mainly. This is an
intermediate commit.
2015-04-22 21:42:17 +03:00
Jan Holesovsky
44553f82c0 loolwsd: Don't even start when the cache dir is not available. 2015-04-21 15:51:28 +02:00
Tor Lillqvist
6d9f298ee9 Prefer C++ std headers 2015-03-28 13:57:10 +02:00
Tor Lillqvist
6e36de4534 For debugging, sleep a bit before initialising LOKit if requested
Set the SLEEPFORDEBUGGER environment variable to the number of seconds a child
process should sleep before calling lok_init(), so that you have time to
attach the process in a debugger.
2015-03-27 18:23:27 +02:00
Tor Lillqvist
cec37456ef Set no receive timeout 2015-03-27 16:53:51 +02:00
Tor Lillqvist
3cb43839ea Cosmetics 2015-03-26 17:04:08 +02:00
Tor Lillqvist
b7c08d373e WaE: private field '_helpRequested' is not used 2015-03-26 14:37:38 +02:00
Tor Lillqvist
e8aa011af4 Undo accidental indentation 2015-03-25 15:48:28 +02:00
Tor Lillqvist
4974ea15b1 Bin leftover debug output 2015-03-20 15:53:00 +02:00
Tor Lillqvist
e8ea0f0d2e Use separate child processes for LibreOfficeKit
For now, each LOOL client has a separate child process (or none at all, if it
has accessed only information found in the cache). This will obviously have to
chnage to handle collaboration. Etc.

The parent process talks the same Websocket protocol with the child
processes. When there is a child process for a client, traffic from the client
is forwarded as such to the child process and vice versa.
2015-03-18 15:38:01 +02:00
Tor Lillqvist
50e36c7ca5 Sort 'using' statements 2015-03-16 19:19:30 +02:00
Tor Lillqvist
ad3fda27af Further hacking on tile cache 2015-03-13 01:34:42 +02:00
Tor Lillqvist
79a4eff2cf Catch and log exceptions in the TestOutput thread 2015-03-12 18:58:51 +02:00
Tor Lillqvist
08583f8ebe Add first cut at caching of tiles 2015-03-12 17:26:35 +02:00
Tor Lillqvist
5c8c36b555 Simplify 2015-03-09 17:45:51 +02:00
Tor Lillqvist
163c08e62e Rename the LOOLWS class to LOOLWSD 2015-03-09 17:45:51 +02:00
Renamed from loolwsd/LOOLWS.cpp (Browse further)