Commit graph

797 commits

Author SHA1 Message Date
Henry Castro
70ff592624 loolwsd: use strsignal 2016-02-03 18:08:16 -04:00
Henry Castro
661ae62259 loolwsd: exit when error no child process 2016-02-03 17:43:04 -04:00
Henry Castro
b7ee46f729 loolwsd: child exit codes are required before fork new lokit process 2016-02-03 17:35:35 -04:00
Henry Castro
1fc3d06e37 loolwsd: fix iterator erase 2016-02-03 17:15:20 -04:00
Henry Castro
3cda799328 loolwsd: avoid the loolbroker block forever before lokit launch 2016-02-03 17:07:36 -04:00
Henry Castro
58fa747bb4 loolwsd: avoid a broken lokit process block the loolbroker forever 2016-02-03 16:59:09 -04:00
Jan Holesovsky
32ecdb8ab6 loolwsd, loleaflet: Handle the ERROR callback.
This introduces a new error id 5 - "document save failed".
2016-02-03 11:24:21 +01:00
Henry Castro
647d7c7783 loolwsd: first, establish pipe connection 2016-02-02 20:09:26 -04:00
Miklos Vajna
aa450a0c38 loolwsd: add clientvisiblearea client -> server command 2016-02-02 11:49:22 +01:00
Miklos Vajna
816663f1e8 loolwsd: update bundled headers 2016-02-02 11:24:54 +01:00
Henry Castro
1b6425913d loolwsd: add LO core exit codes 2016-02-01 22:23:58 -04:00
Henry Castro
5fd2be332a loolwsd: use EXIT_SOFTWARE to indicate internal error 2016-02-01 21:53:16 -04:00
Ashod Nakashian
f3b319ee7f loolwsd: each HTTPServer has its params and skip failed child query
Change-Id: I41c730a935fd0d2e1e3181cced529d414c3aebb0
Reviewed-on: https://gerrit.libreoffice.org/22014
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-02-02 01:51:04 +00:00
Henry Castro
b477f41636 loolwsd: add fatal signals handler 2016-02-01 21:26:19 -04:00
Pranav Kant
7ffd4b45db bccu#1468: handle 'nextmessage:' in prisoner -> master text frames
There are cases when prisoner would send huge text data but
without preceeding 'nextmessage' frames making the master throw
WebSocketException.

Also move the 'nextmessage' frame interpretation logic up in the
'else if' ladder to be able to detect and handle such huge text frames.

Change-Id: Ibe44b69f4ab75c1b8096648c6006316c88366e7c
Reviewed-on: https://gerrit.libreoffice.org/21835
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-02-01 05:09:35 +00:00
Ashod Nakashian
6f5afd92ba loolwsd: fixed server thread-pool
TCPServer doesn't use the custom ThreadPool passed to it
to dispatch connections. This leads to starvation
when too many connections are initiated together.

Because we open an internal socket back to master, we
need to be able to dispatch two connections (two threads)
for each client connection.

Therefore, the default ThreadPool needs to have sufficient
capacity to grow. A new constant is added to define this
capacity and it is used to configure both the TCPServer
(which configures the default ThreadPool) and the customer
ThreadPool (used to host the actuall connection handler).

Change-Id: I49adc039aa99e9350b0defc4a5e141b77524992e
Reviewed-on: https://gerrit.libreoffice.org/21976
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-02-01 05:06:35 +00:00
Ashod Nakashian
57240993b6 loolwsd: removed url cache in favor of unified child cache
Change-Id: I44d07ea3e03a78a6038322c8110f66dd9c161957
Reviewed-on: https://gerrit.libreoffice.org/21975
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-02-01 05:04:38 +00:00
Ashod Nakashian
b596c80e34 loolwsd: simplified child searching
Change-Id: I0d817876f5b83acff69e51c2c64cd6acfa8dc27d
Reviewed-on: https://gerrit.libreoffice.org/21974
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-02-01 05:02:35 +00:00
Ashod Nakashian
450bf8eebe loolwsd: correct pre-spawn childs
Change-Id: Id306176296dde6f63821041eae1b28d23637f18d
Reviewed-on: https://gerrit.libreoffice.org/21934
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-30 15:43:38 +00:00
Ashod Nakashian
a956c61b07 loolwsd: logging
Change-Id: Ie81dc0b890fd59d0073b812117762bb0aff0f579
Reviewed-on: https://gerrit.libreoffice.org/21933
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-30 15:43:07 +00:00
Ashod Nakashian
a2357fbb8b loolwsd: replacing URL cache
Change-Id: I98d754fabdb0f136e31af3852c1cdf1af4ead503
Reviewed-on: https://gerrit.libreoffice.org/21932
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-30 15:42:46 +00:00
Ashod Nakashian
4861bb75f2 loolwsd: child process termination and cleanup
Change-Id: Ib43202dbde92c0223096bad1b9b4d491484b88e0
Reviewed-on: https://gerrit.libreoffice.org/21931
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-30 15:41:35 +00:00
Ashod Nakashian
49ae5b5943 loolwsd: encapsulate child processes in a single object
Change-Id: I2f382c4c2c224d42359e11929423866e41f88526
Reviewed-on: https://gerrit.libreoffice.org/21930
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-30 15:40:50 +00:00
Miklos Vajna
230c9cb4e3 loolwsd: update bundled headers 2016-01-29 14:36:14 +01:00
Miklos Vajna
4b3c5ea8ff loolwsd: doxygenize class comments 2016-01-28 19:16:32 +01:00
Miklos Vajna
1312211f71 loolwsd: -Werror,-Wswitch 2016-01-28 18:17:13 +01:00
Henry Castro
aad79ea3c5 loolwsd: ensure response PID child 2016-01-26 23:28:42 -04:00
Henry Castro
faf2a57d19 loolwsd: eof broker pipe 2016-01-26 21:22:07 -04:00
Henry Castro
35fbb27cfd loolwsd: remove unused private methods 2016-01-25 22:43:03 -04:00
Henry Castro
be33224133 loolwsd: remove unnecessary map ChildProcesses 2016-01-25 21:17:05 -04:00
Henry Castro
2baae1b324 loolwsd: simplify one loolbroker 2016-01-25 21:07:10 -04:00
Henry Castro
6b28433265 loolwsd: Log::warn when the thread pool is full.
When thread pool is full no more connections are accepted.
It is confused as a deadlock
2016-01-25 17:11:51 -04:00
Henry Castro
e3fd07ad0e loolwsd: remove unnecessary inter process mutex
It is no longer needed becuase loolbroker handle connections
2016-01-25 12:26:22 -04:00
Henry Castro
eb2675164f loolwsd: remove unnecessary child PID file log
This is no longer needed due to logging improvements
2016-01-25 11:51:27 -04:00
Henry Castro
1ff52f2e2c loolwsd: remove unnecessary Poco thread default pool 2016-01-25 11:45:50 -04:00
Miklos Vajna
1d6d0741f0 loolwsd: -Werror,-Wtautological-constant-out-of-range-compare 2016-01-25 13:08:37 +01:00
Ashod Nakashian
65e06c1db7 loolwsd: per ChildProcessSession callback queue and thread
By giving dedicated queue to each session we eliminate
the bottleneck that a slow client will introduce
on every other session on the same document.

Change-Id: I715b80a8cd7bbef1268dc472d0b32e35f3dd6444
Reviewed-on: https://gerrit.libreoffice.org/21763
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-24 23:57:54 +00:00
Ashod Nakashian
904bf929f1 loolwsd: throttle traffic for inactive sessions
Sessions that have been inactive for a certain duration,
currently set at 120 seconds, will not receive updates.

A new statistics class tracks the activity of every
session and blocks callback updates from reaching
inactive clients.

Change-Id: I64296488b2c0be0598b218ba89a6d02f057a5f7e
Reviewed-on: https://gerrit.libreoffice.org/21760
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-24 21:14:57 +00:00
Ashod Nakashian
11e8a9bb4f loolwsd: test improvements
Change-Id: Ieeef1019063636cef171cc360f523810f6f989d2
Reviewed-on: https://gerrit.libreoffice.org/21759
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-24 21:12:43 +00:00
Ashod Nakashian
75ede04cd7 loolwsd: improved child forking
Change-Id: Ic05b412bb9c467659c24cba12f385ed9c0c67b84
Reviewed-on: https://gerrit.libreoffice.org/21758
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-24 21:11:54 +00:00
Ashod Nakashian
f9fd4c917a loolwsd: refactored HTTP Request Handler
Change-Id: I84685910afa04664639ae674fd66ff888962387e
Reviewed-on: https://gerrit.libreoffice.org/21757
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-24 21:10:53 +00:00
Ashod Nakashian
b85b4423b0 loolwsd: break the wait on save-as queue and better failure handling
Change-Id: Ifee252b3c189ee0b1287bda891b38c5abddb7440
Reviewed-on: https://gerrit.libreoffice.org/21755
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-24 21:09:28 +00:00
Ashod Nakashian
9593ec5720 loolwsd: improved polling and pong with client
Change-Id: I17c4f7685d23b6e4c84a7f8b34fcb7dbcaf959f9
Reviewed-on: https://gerrit.libreoffice.org/21754
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-24 21:02:16 +00:00
Ashod Nakashian
2bb2e2aec1 loolwsd: protect against empty messages
Change-Id: Ic60c1abf85268c9ad629bc1f981e53688fc6267a
Reviewed-on: https://gerrit.libreoffice.org/21753
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-24 21:01:03 +00:00
Ashod Nakashian
55f2105f00 loolwsd: logging improvements
Change-Id: I77844a2b549c1f497c2d44f054169bf11d9227d8
Reviewed-on: https://gerrit.libreoffice.org/21752
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-24 21:00:34 +00:00
Ashod Nakashian
ef2ec0b2e2 loolwsd: fixes to broker threading and communication
Broker cache clean up is now done only during searching
as there we loop over processes and request status
from each child.

Internal helpers simplified and termination is done
in a single removeChild helper.

Change-Id: I31f7df5429f0737d352842d5c0f6a02b91b8078f
Reviewed-on: https://gerrit.libreoffice.org/21751
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-24 20:59:40 +00:00
Ashod Nakashian
4dc9fa7eb7 loolwsd: prevent deadlock when purging sessions
Change-Id: I293e28674ed721741fa0afc57b37a636833d2e0e
Reviewed-on: https://gerrit.libreoffice.org/21750
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-24 20:58:09 +00:00
Jan Holesovsky
0c509e17c1 loolwsd: Fix /convert-to to handle filenames containing spaces. 2016-01-21 23:30:52 +01:00
Ashod Nakashian
41da8f144e loolwsd: unload command added
Change-Id: I30c42e24aa38c676e4bc6c7e6a2715d9e72430b9
Reviewed-on: https://gerrit.libreoffice.org/21686
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-21 16:07:54 +00:00
Ashod Nakashian
a882ed1aa1 loolwsd: thread safety fixes in broker
Change-Id: Ibfff184ad294c14d6583f7a8282edc4e2742ad52
Reviewed-on: https://gerrit.libreoffice.org/21685
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-21 16:07:02 +00:00