Sends the same 'error: cmd=internal kind=diskfull' message as when
disk space for LOOL's own needs is getting full, but only to the
user(s) of that document. We can't in general know whether one
document in the Storage abstraction is located even close to another.
We will later want to just to a disk space check for the file system a
file is on, without registering that file system for periodic checks.
Adapt callers to keep working like before.
From
/lool/ws/docurl
to
/lool/docurl/ws
The main purpose behind changing this and other related urls is
to help in load-balancing. The first two parts of the URL can now
be used in a hash-based load-balancing algorithm which decides which
slave gets to serve the requests. Requests such as insertfile,
downloadas need to end up in the same slave in which document was opened.
/lool/docurl/ i.e first two parts of the URL are constant for all
the requests that should be served by a single slave.
Change-Id: Ibc605ca1251957b8b32b376cf19b78f6178fadfa
Monitor the disk space on important file systems: The ones where
cached tiles are stored and where the chroot jails are created. Those
might be the same file system of course, the code checks and doesn't
do needless work.
The check is done whenever a new loolkit process is taken into use and
a new chroot jail it constructed, and whenever a new client session
connects to a document. We don't check more often than once a minute,
though.
Still need to add code to guard against running out of diska space
when saving documents back to where they were opened from. For that
presumably need to enhance the Storage abstraction.
Instead of trying to inform the sysadmin (which we did not yet try to
do in any meaningful way), inform all connected clients (even those
editing other documents).
We use 'error: cmd=internal kind=diskfull' as the message to the
clients. The loleaflet code needs to be updated to handle that
carefully by displaying a very prominent message that tells the user
that all bets are off.
Also add a unit test for the functionality.
Document the new protocol details.
The code for this alert functionalty became a bit less elegant than I
like because of the way we include Util.cpp in the unit test 'test'
program.
Still need to add code to check for disk full in more places, not just
when saving a cached tile or font. Probably we should even actually
check for disk space on the file system(s) we use getting alarmingly
low, not just check for file writing operations that fail. Later.
Tile queue was used to process canceltiles commands.
Since those are handled by TileCache, there is no need
for queues and the threads that pump them.
But because these queues were also used to buffer between
WSD internals and clients, such that a slow client wouldn't
block WSD while sending back tiles, it is necessary
to reword that logic.
In subsequent commits that will change as well.
With this change not only do we save a thread per client,
but we also reduce latency of tile, and improve typing
responsiveness, by almost 3x or more! Latencies are
down to ~15ms from almost 50ms.
Reviewed-on: https://gerrit.libreoffice.org/28575
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
(cherry picked from commit 59eaacd2f8)
Change-Id: I77813267a95a724491165792ec020ae00953c05e
Reviewed-on: https://gerrit.libreoffice.org/29066
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
When 2 users opened the document at the very same time, it happened that new
jails / instances were created for the document twice.
As a solution, insert a dummy (marked to destroy) document into the map of
DocumentBrokers, which will lead into synchronization between the two
instances.
[I suppose the synchronization did not work previously either, as emplace()
does not seem to modify the value when the key is already in the map.]
Tile queue was used to process canceltiles commands.
Since those are handled by TileCache, there is no need
for queues and the threads that pump them.
But because these queues were also used to buffer between
WSD internals and clients, such that a slow client wouldn't
block WSD while sending back tiles, it is necessary
to reword that logic.
In subsequent commits that will change as well.
With this change not only do we save a thread per client,
but we also reduce latency of tile, and improve typing
responsiveness, by almost 3x or more! Latencies are
down to ~15ms from almost 50ms.
Change-Id: I9bb5856efed28caea9d4e6f94f77b093779e5241
Reviewed-on: https://gerrit.libreoffice.org/28575
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Compression to .gz is supported and is controlled
via the XML configuration.
Change-Id: If26fad2c0b5f3c4ffd93362608644dc917172a41
Reviewed-on: https://gerrit.libreoffice.org/27975
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>