diff options
author | Robert Adam <dev@robert-adam.de> | 2021-03-08 22:57:42 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-08 22:57:42 +0300 |
commit | 988422d0e6585159dfb0bb8a8639ba20d13c5fe2 (patch) | |
tree | 59dfc1fe3f0b44c32d71060639553beef2403d79 /src | |
parent | e79992b4b17cc1625396b164f9ad9e736b072d76 (diff) | |
parent | 4ab0a06f6e157d6b7922b7bab4c4718cd34c26a6 (diff) |
Merge pull request #4833: FIX(grpc): Replace call to processEvents to circumvent exceeding 100ms timeout freezing
While working with gRPC I ran up against an issue where using the bidirectional streams results in the server freezing after some time. I believe this is the result of the 100ms timeout on the call to processEvents. I changed out the method to one recommended by the Qt docs when using a local loop, but I believe the core of the issue to be with the timeout. With this change applied, my server has been running for 5+ days without running into the issue (normal use) where previously the longest it ever lasted was 2 days.murmur.
Diffstat (limited to 'src')
-rw-r--r-- | src/murmur_grpcwrapper_protoc_plugin/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/murmur_grpcwrapper_protoc_plugin/main.cpp b/src/murmur_grpcwrapper_protoc_plugin/main.cpp index ea6e19112..e4bbc334c 100644 --- a/src/murmur_grpcwrapper_protoc_plugin/main.cpp +++ b/src/murmur_grpcwrapper_protoc_plugin/main.cpp @@ -143,7 +143,7 @@ public: }; stream.Write(response, callback(cb)); while (!processed) { - QCoreApplication::processEvents(QEventLoop::ExcludeSocketNotifiers, 100); + QCoreApplication::sendPostedEvents(); } return success; } @@ -157,7 +157,7 @@ public: }; stream.Read(&request, callback(cb)); while (!processed) { - QCoreApplication::processEvents(QEventLoop::ExcludeSocketNotifiers, 100); + QCoreApplication::sendPostedEvents(); } return success; } |