You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2022/02/28 08:33:31 UTC

[buildstream] 01/04: _testing/_fixtures.py: Added comment/hint around gRPC thread assertions

This is an automated email from the ASF dual-hosted git repository.

tvb pushed a commit to branch tristan/fix-leaking-grpc-threads
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit fa775a604f6ef97b58bfe7747310880843d4743b
Author: Tristan van Berkom <tr...@codethink.co.uk>
AuthorDate: Mon Feb 28 17:25:59 2022 +0900

    _testing/_fixtures.py: Added comment/hint around gRPC thread assertions
    
    When you find yourself painfully wondering what might be causing this
    thread assertion to trigger, it can be useful to have a comment telling
    you that it is probably due to BuildStream failing to close a gRPC channel.
---
 src/buildstream/_testing/_fixtures.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/buildstream/_testing/_fixtures.py b/src/buildstream/_testing/_fixtures.py
index c2b8bb2..a4bba80 100644
--- a/src/buildstream/_testing/_fixtures.py
+++ b/src/buildstream/_testing/_fixtures.py
@@ -27,6 +27,10 @@ _AWAIT_THREADS_TIMEOUT_SECONDS = 5
 
 def has_no_unexpected_background_threads(expected_num_threads):
     # Use psutil as threading.active_count() doesn't include gRPC threads.
+    #
+    # If background gRPC threads are lingering, there is a good chance that
+    # this is due to BuildStream failing to close an open grpc channel.
+    #
     process = psutil.Process()
 
     wait = 0.1