To silence errors until feature arrives. Occurs after
following core commit:
11b936629dd4ef9308d63b312900b8b7c8ff19b4
Signed-off-by: Aron Budea <aron.budea@collabora.com>
Change-Id: I6d9b01b265e3f07db2bc4ac7da46cbfcd0e17da5
Warn, flag save as failed, and disable bgsave in these cases,
perhaps we will not crash main kit process next time around.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ia4f3d079a5503739efc11e408ed431c3b652860b
No known test vector for this, but it may happen and we don't
want to hang saving with non-interactive interactive UI coming
from the bigsave process, that can't get events back.
If this happens - something is very odd, and we should disable
background save; so do that and try to clean-up in time.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ifde2fe9ac8719321e38695725981b1f8b2b554f5
Enable Caolan's unit test, pass the proper 'disconnect' message
to the Kit so it can close the underlying window / resource for
the view.
Potentially this also removes 'phantom' users in the user-list
which might be another symptom of this issue.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ib0d0c5cefa7033fff5827d0a825a932cc12f8323
Causing excessive logging in error; we would find the right session
next time around the loop; from:
commit 6f49f9398e
Author: Michael Meeks <michael.meeks@collabora.com>
Date: Thu May 9 09:19:44 2024 +0100
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I33f696e4fae899a896d94cbeb70d5d9306f3b414
We don't want to send these to coolwsd, they have confusingly
different Modified state from the bgsave process - which is now
unmodified after save.
Really we should filter out almost all messages from the
bgsave process and not forward them.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ifaea028f080e31705256a2d72cf4ab03dfd94187
Significantly calmer and less frenzied logging output.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I0f1782c0b8f10ac3427bac479ded2862f2b40b7a
Add logging.disabled_areas setting to coolwsd.xml with some sensible
things to ignore unless they are warnings/errors.
Kit code duplication around logging is grim; but not fixed in this
commit.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I36bebb2b3c8d64a814d7b10c167d582de0baf4e5
To avoid the HTTP[S] request racing the websocket and sometimes
loosing we need to:
* get a notification from the Kit when the copy / cut is complete
* wait on a Promise for this, to allow the HTTP fetch to start
* re-work to do a single, rather than two fetches by sharing
the download promise.
Change-Id: Ic23f7f817cc855ff08f25a2afefcd73d6fc3472b
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
If we had a tilecombine processed in the same queue and before
a save - the 'render tiles at the end' state would be inherited by
the background save process and result in excess work, and also
binary messages where only text messages are expected returning.
The rest of the queue is cleared post fork.
Add unit test - plus hook to hold queue processing.
Change-Id: Iee937897000bc3ac149599844f1eab005affb131
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Free CPU cycles for interactive processes.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I9d8cfe5f3541c9424d51c69380e1c72920154ff4
Now we always send callbacks as soon as possible back to wsd from the
kit. This has several implications:
1. even when InputProcessing is disabled we will send outbound
progress updates.
2. we should send callbacks much more quickly without waiting for
other queue events to be processed eg. tilecombine:
We also drastically simplify storage of callbacks, avoiding lots of
re-parsing of the same strings, and allow much more efficient
comparison and merging at a small space cost in queue size.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ia1ede5406767f895616a52775316ee6ab1c5db09
also rename and dissolve the previously virtual _impl methods.
Change-Id: Id77a5c3ce79b27406301ef336ac1c9a40ead15bf
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
This is not common code, it's used only in the Kit.
Rename TileQueue -> KitQueue as well as unhelpful member variable naming.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: If158597f99f302cbc27e8eab139972f57a2fc3bb
The MessageQueue is not a generic message queue, it has much more
un-anticipated functionality; so don't use it where we don't need to.
In particular unexpected re-writing and merging of messages
during tests is probably not a great idea.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I657738307e611be18f5f83e11c055bf8a88826da
We need to mark core unmodified so we can track modifications
to the core that date from after the background save process is
forked.
We avoid telling WSD about our new modification status until
we are sure the background save completed successfully, and only
in the case that we have not been subsequently modified.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I2c9fbce942ff0af2bb727c3685f4ec479e18fa27
We need to get more helpful structure into this message, and add a
type=bg flag to handle background progress messages.
Add unit test for merging progress: setvalue commands.
Simplify ProtocolHandler sendTextMessage with a std::string wrapper.
Android code needs manual testing.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I54ce807e2fc5de80118905e68557a95e637fbd18
as well as current ones.
i.e.
/// User Info container used to store user information
/// till the end of process lifecycle - including
/// after any child session goes away
so add some info in the log to flag which ones are still connected and
which ones are not.
https: //github.com/CollaboraOnline/online/issues/8943
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I5350c04d1a7bb8095464881fba97e5910f71ffb3
coolforkit: common/Log.cpp:677: void Log::shutdown(): Assertion
`ThreadLocalBufferCount <= 1 && "Unstopped threads may have unflushed
buffered log entries"' failed.
Was caused by mis-accounting. Also join document threads on 'exit'
which happens during unit tests to ensure we don't hit the above.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I523e723e54e4252ae0d65de36af086e97dd79f04
Simple example to re-instate previous unit test.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I26da1178bc897797a656eb5ae9f838d17cbaf75f
This added 200+ lines of code, made things harder to
understand, and was used only in a single test that can be
covered in another way.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I4ed8d1d52d533f8b24be7dd5e12dbb7702ef1a80
Centralize more logging functionality in Log.cpp, simplify and
wrap underlying logging APIs better.
Code is much more generic, and hides implementation details
much more thoroughly, while keeping the same API / wrappers.
To do this we have to sub-class Poco::Logger to get access to
its generic 'log' method instead of a mess of in-line wrappers,
this lets us avoid lots of code.
Change-Id: I541d3aef49f99ce582655c5102a0041bf84cd56a
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
There is a race here, clearly if you type while a background
save is ongoing - but this is far better than leaving the
document apparently unmodified.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ie5e3e692294e48ad887481af2e0906092830f265
Otherwise we go on doing work that the parent kit process should do eg.
[ kitbgsv_006_002 ] TRC ToMaster-8f9: saveDocumentBackground returns succesful start.| kit/ChildSession.cpp:887
[ kitbgsv_006_002 ] TRC Calling paintPartTile(0x4c0716f0)| common/RenderTiles.hpp:130
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I257f61d05d8a0da0c8eb9d8c60e502da66dc8cdd
Get the polarity of the check on whether we succeeded to spawn a
background save process right, so we don't spawn two saves
concurrently, and block input processing in the wrong place.
Also a few obvious sillies fixed, and some more assertions for
good measure; was not good:
[ kitbgsv_001_001 ] TRC ToMaster-002: Finished synchronous background saving ...| kit/ChildSession.cpp:882
[ kitbgsv_001_001 ] TRC ToMaster-002: saveDocumentBackground returns succesful start.| kit/ChildSession.cpp:887
[ kitbgsv_001_001 ] TRC Document - input processing now: disabled was enabled| kit/Kit.cpp:2095
[ kitbgsv_001_001 ] TRC ToMaster-002: uno command .uno:Save {... notify: true| kit/ChildSession.cpp:1944
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ie06a74a538bdd5038ca9c94b422f27cff9e4a82e
Somehow this state can get confused in a bgsave process:
Kit Document:
...
inputProcessingEnabled: false
...
SocketPoll:
Poll [kit] with 1 socket - wakeup rfd: 39 wfd: 45
fd events rbuffered wbuffered rtotal wtotal
52 0x1 process 0 0 r: 825
'process' should read 'ignore' for disabled input.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I787eebe6fda3ae1b527d7605b8813fa764e81890
It seems we've had input processing turned off more than expected
recently, if we have an event or callback in the queue, it seems
we set our timeout to zero.
Since we would not be processing input this would never change,
and we would just busy spin indefinitely; just lots of:
[ kitbgsv_001_001 ] TRC ppoll start, timeoutMicroS: 0 size 1| net/Socket.cpp:404
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Ib374c6ce12d467eba602c7eaee99cc3940ffe681
problem:
in LOK/online to support async save, files in jails may have
different extensions (ie: .upload, .uploading)
this caused problem to detect files as original file name may not exist.
As result property like file size were always set to 0
chronology of events:
1. File is saved normally with existing name
2. After saved we make it ready for upload and add extension .upload in "renameForUpload"(kit/ChildSession.cpp)
3 We change to .uploading extension when we are uploading (DocumentBroker::handleSaveResponse, DocumentBroker::uploadAfterLoadingTemplate)
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: Ibda40b0c134ef6baef9edb0427b3c56340924858
but impress/draw should continue to use the existing document
preference. Writer and Calc have spell as a pre-view feature, while
impress/draw still has it per document.
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ieb8c307b13f2ee010e09058a1ba63c7808637487
Hard closing without shutdown is necessary, but we continued to poll
and read on an fd that would be re-used to open eg. a ZIP file:
[ kitbgsv_007_001 ] TRC #19: Incoming WebSocket data of 13522 bytes: 50 4B 03 04 14 00 00 08 00 00 29 9C 90 58 33 26 AC A8 2F 00 00 00 2F 00 00 00 08 00 00 00 6D 69 | PK........)..X3&../.../.......m"
...
[ kitbgsv_007_001 ] ERR #19: An unfragmented message or the first fragment of a fragmented message must have the opcode different than 0| net/WebSocketHandler.hpp:452
which would then close the file unhelpfully.
Not removing the socketHandler when cleaning up means that
we trigger the ForKit's ServerWSHandler::onDisconnect which
SigUtil::setTerminationFlag() causing all 2nd kit processes
to expire on start.
We also want to ensure that we update the thread-id of the last
forkit process before we start removing sockets and checking
thread-ids.
We want to get rid of the parent process' sockets we inherited
but don't need very cleanly post fork.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I82966f4421fc96df552fd50cf81c8b0bc92b9bbb