9f5bd85008
The use of a common threadname suffix in the WSD and Kit
processes is intentional. It is designed to help filter
for a single document's logs across both processes.
The thread name has nothing to do with the classes in
the code, nor is it intended to imply any relationship
except with the process and the document in question.
As the comment in this patch explains, the choice of
the suffix is arbitrary and while it may be changed,
it has to be sensible and common between the two threads
to allow for easy grepping.
Historically, there were in fact dedicated threads
within the respective "broker" classes, but this
fact should be safely ignored, since at the log level
we care less about which part of the code generates a
log entry (that info, if needed, is at the end of each
log entry, in the form of filename and line number),
rather we care more about which document it relates to,
which is crucial in investigating production issues.
Logs and code structure are only incidentally related.
Logs are (or at least should be) designed around
the execution structure, not code architecture.
(This reverts 2a16f34812
)
Change-Id: Ic6fe2f9425998824774d2644fe4362e75dea6b88
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101261
Tested-by: Jenkins
Tested-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
67 lines
2.8 KiB
C++
67 lines
2.8 KiB
C++
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
|
|
/*
|
|
* This file is part of the LibreOffice project.
|
|
*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
// Default values and other shared data between processes.
|
|
|
|
constexpr int DEFAULT_CLIENT_PORT_NUMBER = 9980;
|
|
|
|
constexpr int COMMAND_TIMEOUT_MS = 5000;
|
|
constexpr int CHILD_TIMEOUT_MS = COMMAND_TIMEOUT_MS;
|
|
constexpr int CHILD_REBALANCE_INTERVAL_MS = CHILD_TIMEOUT_MS / 10;
|
|
constexpr int POLL_TIMEOUT_MICRO_S = (COMMAND_TIMEOUT_MS / 5) * 1000;
|
|
constexpr int WS_SEND_TIMEOUT_MS = 1000;
|
|
|
|
constexpr int TILE_ROUNDTRIP_TIMEOUT_MS = 5000;
|
|
|
|
/// Pipe and Socket read buffer size.
|
|
/// Should be large enough for ethernet packets
|
|
/// which can be 1500 bytes long.
|
|
constexpr long READ_BUFFER_SIZE = 64 * 1024;
|
|
|
|
/// Message larger than this will be dropped as invalid
|
|
/// or as intentionally flooding the server.
|
|
constexpr int MAX_MESSAGE_SIZE = 2 * 1024 * READ_BUFFER_SIZE;
|
|
|
|
constexpr const char JAILED_DOCUMENT_ROOT[] = "/tmp/user/docs/";
|
|
constexpr const char CHILD_URI[] = "/loolws/child?";
|
|
constexpr const char NEW_CHILD_URI[] = "/loolws/newchild";
|
|
constexpr const char LO_JAIL_SUBPATH[] = "lo";
|
|
constexpr const char FORKIT_URI[] = "/loolws/forkit";
|
|
|
|
constexpr const char CAPABILITIES_END_POINT[] = "/hosting/capabilities";
|
|
|
|
/// A shared threadname suffix in both the WSD and Kit processes
|
|
/// is highly helpful for filtering the logs for the same document
|
|
/// by simply grepping for this shared suffix+ID. e.g. 'grep "broker_123" loolwsd.log'
|
|
/// Unfortunately grepping for only "_123" would include more noise than desirable.
|
|
/// This also makes the threadname symmetric and the entries aligned.
|
|
/// The choice of "broker" as the suffix is historic: it implies the controller
|
|
/// of which there are two: one in WSD called DocumentBroker and one in Kit
|
|
/// called Document, which wasn't called DocumentBroker to avoid confusing it
|
|
/// with the one in WSD. No such confusion should be expected in the logs, since
|
|
/// the prefix is "doc" and "kit" respectively, and each log entry has the process
|
|
/// name prefixed. And of course these threads are unrelated to the classes in
|
|
/// the code: they are logical execution unit names.
|
|
#define SHARED_DOC_THREADNAME_SUFFIX "broker_"
|
|
|
|
/// The HTTP response User-Agent.
|
|
#define HTTP_AGENT_STRING "LOOLWSD HTTP Agent " LOOLWSD_VERSION
|
|
|
|
/// The WOPI User-Agent.
|
|
#define WOPI_AGENT_STRING "LOOLWSD WOPI Agent " LOOLWSD_VERSION
|
|
|
|
// The client port number, both loolwsd and the kits have this.
|
|
extern int ClientPortNumber;
|
|
extern std::string MasterLocation;
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|