Bug 135897 - [WOPI] Client Session is not cleaned properly when check file info is failed
Summary: [WOPI] Client Session is not cleaned properly when check file info is failed
Status: UNCONFIRMED
Alias: None
Product: LibreOffice Online
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-18 23:47 UTC by Rangga
Modified: 2021-11-26 04:44 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rangga 2020-08-18 23:47:00 UTC
When LibreOffice Online is trigger checkFileInfo and WOPI host not returning 200 (OK), LibreOffice Online not calling Client Session Destructor, which will make the number of session keeps increasing and memory leak happens.

Probably the cause is because, when checkFileInfo is failed, LibreOfficeOnline does not put the client session on DocumentBroker's sessions map, which resulting it will fails to clean up the session because it cannot find the session on Document Broker's session map.

Logs are as follow.

<pre>
wsd-00006-01627 2020-08-16 20:27:40.311115 [ docbroker_0bc ] INF  Thread 1627 (7fea8dffb700) of process 6 formerly unnamed is now called [docbroker_0bc].| common/Util.cpp:577
wsd-00006-01627 2020-08-16 20:27:40.311234 [ docbroker_0bc ] INF  Starting polling thread [docbroker_0bc] with thread affinity set to 0x7fea8dffb700.| net/Socket.cpp:179
wsd-00006-01627 2020-08-16 20:27:40.311265 [ docbroker_0bc ] INF  Starting docBroker polling thread for docKey [/alfresco/s/wopi/files/db23baa9-e412-49ca-be24-6a6a434afa3f].| wsd/DocumentBroker.cpp:222
wsd-00006-01627 2020-08-16 20:27:40.311400 [ docbroker_0bc ] INF  Filesystem [/opt/online/jails/.] has 5730 MB free (29.1272%).| common/FileUtil.cpp:400
wsd-00006-01627 2020-08-16 20:27:40.313206 [ docbroker_0bc ] INF  Doc [/alfresco/s/wopi/files/db23baa9-e412-49ca-be24-6a6a434afa3f] attached to child [1558].| wsd/DocumentBroker.cpp:272
wsd-00006-01627 2020-08-16 20:27:40.313601 [ docbroker_0bc ] INF  Loading [/alfresco/s/wopi/files/db23baa9-e412-49ca-be24-6a6a434afa3f] for session [c5bc] and jail [Ocb109d8VB7kg1OG].| wsd/DocumentBroker.cpp:533
wsd-00006-01627 2020-08-16 20:27:40.313754 [ docbroker_0bc ] INF  jailPath: /user/docs/Ocb109d8VB7kg1OG, jailRoot: /opt/online/jails/Ocb109d8VB7kg1OG| wsd/DocumentBroker.cpp:557
wsd-00006-01627 2020-08-16 20:27:40.313890 [ docbroker_0bc ] INF  Public URI [https://alfresco.wgtn.cat-it.co.nz/alfresco/s/wopi/files/db23baa9-e412-49ca-be24-6a6a434afa3f?access_token=2um6n8ka99dv78q42p7gmh57g&access_token_ttl=1597613851130&permission=edit] considered WOPI.| wsd/Storage.cpp:271
wsd-00006-01627 2020-08-16 20:27:40.314203 [ docbroker_0bc ] INF  WopiStorage ctor with localStorePath: [/opt/online/jails/Ocb109d8VB7kg1OG], jailPath: [/user/docs/Ocb109d8VB7kg1OG], uri: [https://alfresco.wgtn.cat-it.co.nz/alfresco/s/wopi/files/db23baa9-e412-49ca-be24-6a6a434afa3f?access_token=2um6n8ka99dv78q42p7gmh57g&access_token_ttl=1597613851130&permission=edit], reuseCookies: [false].| wsd/Storage.hpp:361
wsd-00006-01627 2020-08-16 20:27:40.404698 [ docbroker_0bc ] ERR  WOPI::CheckFileInfo failed with 400 400| wsd/Storage.cpp:555
wsd-00006-01627 2020-08-16 20:27:40.405897 [ docbroker_0bc ] ERR  loading document exception: WOPI::CheckFileInfo failed| wsd/DocumentBroker.cpp:1334
wsd-00006-01627 2020-08-16 20:27:40.406089 [ docbroker_0bc ] ERR  Failed to add session to [/alfresco/s/wopi/files/db23baa9-e412-49ca-be24-6a6a434afa3f] with URI [https://alfresco.wgtn.cat-it.co.nz/alfresco/s/wopi/files/db23baa9-e412-49ca-be24-6a6a434afa3f?access_token=2um6n8ka99dv78q42p7gmh57g&access_token_ttl=1597613851130&permission=edit]: WOPI::CheckFileInfo failed| wsd/DocumentBroker.cpp:1296
wsd-00006-01627 2020-08-16 20:27:40.406218 [ docbroker_0bc ] INF  Doc [/alfresco/s/wopi/files/db23baa9-e412-49ca-be24-6a6a434afa3f] has no more sessions. Marking to destroy.| wsd/DocumentBroker.cpp:1299
wsd-00006-01627 2020-08-16 20:27:40.406371 [ docbroker_0bc ] INF  Terminating dead DocumentBroker for docKey [/alfresco/s/wopi/files/db23baa9-e412-49ca-be24-6a6a434afa3f].| wsd/DocumentBroker.cpp:426
wsd-00006-01627 2020-08-16 20:27:40.406504 [ docbroker_0bc ] INF  Finished polling doc [/alfresco/s/wopi/files/db23baa9-e412-49ca-be24-6a6a434afa3f]. stop: true, continuePolling: true, ShutdownRequestFlag: false, TerminationFlag: false, closeReason: dead. Flushing socket.| wsd/DocumentBroker.cpp:433
wsd-00006-01627 2020-08-16 20:27:40.406599 [ docbroker_0bc ] INF  Flushing socket for doc [/alfresco/s/wopi/files/db23baa9-e412-49ca-be24-6a6a434afa3f] for 2000 ms. stop: true, continuePolling: true, ShutdownRequestFlag: false, TerminationFlag: false. Terminating child with reason: [dead].| wsd/DocumentBroker.cpp:449
wsd-00006-01627 2020-08-16 20:27:40.406757 [ docbroker_0bc ] ERR  No DocBroker found, or DocBroker marked to be destroyed. Terminating session ToClient-c5bc| wsd/ClientSession.cpp:325
wsd-00006-01627 2020-08-16 20:27:40.406893 [ docbroker_0bc ] ERR  No DocBroker found, or DocBroker marked to be destroyed. Terminating session ToClient-c5bc| wsd/ClientSession.cpp:325
wsd-00006-01627 2020-08-16 20:27:40.406986 [ docbroker_0bc ] ERR  No DocBroker found, or DocBroker marked to be destroyed. Terminating session ToClient-c5bc| wsd/ClientSession.cpp:325
wsd-00006-01627 2020-08-16 20:27:40.407093 [ docbroker_0bc ] ERR  No DocBroker found, or DocBroker marked to be destroyed. Terminating session ToClient-c5bc| wsd/ClientSession.cpp:325
wsd-00006-01627 2020-08-16 20:27:40.407195 [ docbroker_0bc ] ERR  No DocBroker found, or DocBroker marked to be destroyed. Terminating session ToClient-c5bc| wsd/ClientSession.cpp:325
wsd-00006-01627 2020-08-16 20:27:40.407284 [ docbroker_0bc ] ERR  No DocBroker found, or DocBroker marked to be destroyed. Terminating session ToClient-c5bc| wsd/ClientSession.cpp:325
wsd-00006-01627 2020-08-16 20:27:40.407376 [ docbroker_0bc ] ERR  No DocBroker found, or DocBroker marked to be destroyed. Terminating session ToClient-c5bc| wsd/ClientSession.cpp:325
wsd-00006-01627 2020-08-16 20:27:40.506317 [ docbroker_0bc ] INF  ToClient-c5bc Disconnected, current number of connections: 158| wsd/ClientSession.cpp:1634
kit-01628-00014 2020-08-16 20:27:40.557885 [ kit_spare_0bd ] INF  Initializing kit. Local time: Mon 2020-08-17 08:27:40+1200. Log level is [6].| common/Log.cpp:211
kit-01628-00014 2020-08-16 20:27:40.558243 [ kit_spare_0bd ] INF  User-data anonymization is disabled.| kit/Kit.cpp:2395
kit-01628-00014 2020-08-16 20:27:40.558500 [ kit_spare_0bd ] INF  Jail path: /opt/online/jails/sD7yVXaPqi5tdB4Z/| kit/Kit.cpp:2421
wsd-00006-01627 2020-08-16 20:27:40.506796 [ docbroker_0bc ] ERR  Invalid or unknown session [c5bc] to remove.| wsd/DocumentBroker.cpp:1371
wsd-00006-00018 2020-08-16 20:27:40.677576 [ websrv_poll ] INF  #18: Client HTTP Request: GET /lool/https%3A%2F%2Falfresco.wgtn.cat-it.co.nz%2Falfresco%2Fs%2Fwopi%2Ffiles%2Fdb23baa9-e412-49ca-be24-6a6a434afa3f%3Faccess_token%3D2um6n8ka99dv78q42p7gmh57g%26access_token_ttl%3D1597613851130%26permission%3Dedit/ws?WOPISrc=https://alfresco.wgtn.cat-it.co.nz/alfresco/s/wopi/files/db23baa9-e412-49ca-be24-6a6a434afa3f&compat=/ws HTTP/1.1 / Host: lool.alfresco.wgtn.cat-it.co.nz / User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0 / Accept: */* / Accept-Language: en-US,en;q=0.5 / Accept-Encoding: gzip, deflate, br / Sec-WebSocket-Version: 13 / Origin: https://lool.alfresco.wgtn.cat-it.co.nz / Sec-WebSocket-Extensions: permessage-deflate / Sec-WebSocket-Key: XhT7ES7l6IfJqYVQy1r8kg== / Connection: Upgrade / Pragma: no-cache / Cache-Control: no-cache / Upgrade: websocket / X-HAProxy-loolwsd: https://alfresco.wgtn.cat-it.co.nz/alfresco/s/wopi/files/db23baa9-e412-49ca-be24-6a6a434afa3f / X-Forwarded-Port: 443 / X-Forwarded-Proto: https| net/Socket.cpp:680

</pre>
Comment 1 Rangga 2020-08-20 23:35:22 UTC
If you need more details or if there any comments please let me know
Comment 2 Xisco Faulí 2021-11-23 10:55:10 UTC
Hello Rangga,
is this issue still reproducible with the latest version of LibreOffice Online ?
Comment 3 Rangga 2021-11-26 03:40:34 UTC
Hi, Currently I am using the Collabora (CODE) version of LibreOffice Online. And I am testing a relatively new version (6.4.14) and yes, this is still reproducible.
Comment 4 QA Administrators 2021-11-26 04:44:57 UTC Comment hidden (obsolete)