[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2-2' - net/Socket.cpp net/Socket.hpp wsd/DocumentBroker.cpp wsd/DocumentBroker.hpp
Jan Holesovsky (via logerrit)
logerrit at kemper.freedesktop.org
Wed Apr 8 13:15:48 UTC 2020
net/Socket.cpp | 5 -----
net/Socket.hpp | 31 +------------------------------
wsd/DocumentBroker.cpp | 16 ++--------------
wsd/DocumentBroker.hpp | 3 ---
4 files changed, 3 insertions(+), 52 deletions(-)
New commits:
commit fd91687f8f62c8779faf82b8296857d32e900972
Author: Jan Holesovsky <kendy at collabora.com>
AuthorDate: Wed Apr 8 14:33:24 2020 +0200
Commit: Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Apr 8 15:15:29 2020 +0200
Revert "wsd: minimize wait when DocBroker terminates"
With this, the editing session on Android returns without proper cleanup
which leads to occassional hangs when the user tries to open a new
editing session quickly.
This reverts commit a73590d81f4cf910568aa49f73e78abfb412eab7.
Change-Id: Ia77fe2fd9b59d30c343ca1e10f69d5a434bc3628
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91915
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
diff --git a/net/Socket.cpp b/net/Socket.cpp
index cb19c99cd..5bb1fa250 100644
--- a/net/Socket.cpp
+++ b/net/Socket.cpp
@@ -200,11 +200,6 @@ void SocketPoll::wakeupWorld()
wakeup(fd);
}
-bool ProtocolHandlerInterface::hasPendingWork() const
-{
- return _msgHandler && _msgHandler->hasQueuedMessages();
-}
-
#if !MOBILEAPP
void SocketPoll::insertNewWebSocketSync(
diff --git a/net/Socket.hpp b/net/Socket.hpp
index fd0a5278d..ab56e5d10 100644
--- a/net/Socket.hpp
+++ b/net/Socket.hpp
@@ -162,9 +162,6 @@ public:
std::chrono::steady_clock::time_point now,
int events) = 0;
- /// Is all data sent, so tha we can shutdown ?
- virtual bool hasPendingWork() const { return false; }
-
/// manage latency issues around packet aggregation
void setNoDelay()
{
@@ -293,7 +290,7 @@ public:
}
/// Asserts in the debug builds, otherwise just logs.
- void assertCorrectThread() const
+ void assertCorrectThread()
{
if (InhibitThreadChecks)
return;
@@ -395,9 +392,6 @@ public:
_msgHandler = msgHandler;
}
- /// Do we have something to send ?
- virtual bool hasPendingWork() const;
-
/// Clear all external references
virtual void dispose() { _msgHandler.reset(); }
@@ -779,21 +773,6 @@ public:
return _pollSockets.size();
}
- bool hasPendingWork() const
- {
- assertCorrectThread();
-
- if (_newCallbacks.size() > 0 ||
- _newSockets.size() > 0)
- return true;
-
- for (auto &i : _pollSockets)
- if (i->hasPendingWork())
- return true;
-
- return false;
- }
-
const std::string& name() const { return _name; }
/// Start the polling thread (if desired)
@@ -952,14 +931,6 @@ public:
return events;
}
- bool hasPendingWork() const override
- {
- assertCorrectThread();
- if (!_outBuffer.empty() || !_inBuffer.empty())
- return true;
- return _socketHandler && _socketHandler->hasPendingWork();
- }
-
/// Send data to the socket peer.
void send(const char* data, const int len, const bool flush = true)
{
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 0d5ce909d..ca5cc28d9 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -452,14 +452,14 @@ void DocumentBroker::pollThread()
<< ", TerminationFlag: " << SigUtil::getTerminationFlag()
<< ". Terminating child with reason: [" << _closeReason << "].");
const auto flushStartTime = std::chrono::steady_clock::now();
- while (_poll->hasPendingWork() || hasDisconnectingSessions())
+ while (_poll->getSocketCount())
{
const auto now = std::chrono::steady_clock::now();
const int elapsedMs = std::chrono::duration_cast<std::chrono::milliseconds>(now - flushStartTime).count();
if (elapsedMs > flushTimeoutMs)
break;
- _poll->poll(std::min(flushTimeoutMs - elapsedMs, POLL_TIMEOUT_MS / 10));
+ _poll->poll(std::min(flushTimeoutMs - elapsedMs, POLL_TIMEOUT_MS / 5));
}
LOG_INF("Finished flushing socket for doc [" << _docKey << "]. stop: " << _stop << ", continuePolling: " <<
@@ -484,18 +484,6 @@ void DocumentBroker::pollThread()
LOG_INF("Finished docBroker polling thread for docKey [" << _docKey << "].");
}
-bool DocumentBroker::hasDisconnectingSessions() const
-{
- for (const auto& pair : _sessions)
- {
- const std::shared_ptr<ClientSession> &session = pair.second;
- // need to wait around to fetch clipboards from disconnecting sessions.
- if (session->inWaitDisconnected())
- return true;
- }
- return false;
-}
-
bool DocumentBroker::isAlive() const
{
if (!_stop || _poll->isAlive())
diff --git a/wsd/DocumentBroker.hpp b/wsd/DocumentBroker.hpp
index 251e97bba..136167f15 100644
--- a/wsd/DocumentBroker.hpp
+++ b/wsd/DocumentBroker.hpp
@@ -328,9 +328,6 @@ private:
/// Starts the Kit <-> DocumentBroker shutdown handshake
void disconnectSessionInternal(const std::string& id);
- /// Are any of our sessions still dis-connecting ?
- bool hasDisconnectingSessions() const;
-
/// Forward a message from child session to its respective client session.
bool forwardToClient(const std::shared_ptr<Message>& payload);
More information about the Libreoffice-commits
mailing list