Skip to content

increase tunnel client pool size and keepalive interval#474

Open
kcoopermiller wants to merge 2 commits intomainfrom
feature/frpc-timeouts
Open

increase tunnel client pool size and keepalive interval#474
kcoopermiller wants to merge 2 commits intomainfrom
feature/frpc-timeouts

Conversation

@kcoopermiller
Copy link
Copy Markdown
Member

@kcoopermiller kcoopermiller commented Mar 26, 2026

Note

Low Risk
Low risk configuration tuning, but the larger connection pool may increase client/server resource usage and could impact connection behavior under load.

Overview
Adjusts the generated frpc client config to use a longer TCP mux keepalive interval (30s60s) and a larger connection pool (1050) for Prime Tunnel connections.

Written by Cursor Bugbot for commit 893bbdb. This will update automatically on new commits. Configure here.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: New _kill_process duplicates existing process-killing logic
    • sync_stop and _cleanup now call _kill_process, removing duplicated terminate/wait/kill logic and centralizing process shutdown behavior.

Create PR

Or push these changes by commenting:

@cursor push 64eafec117
Preview (64eafec117)
diff --git a/packages/prime-tunnel/src/prime_tunnel/tunnel.py b/packages/prime-tunnel/src/prime_tunnel/tunnel.py
--- a/packages/prime-tunnel/src/prime_tunnel/tunnel.py
+++ b/packages/prime-tunnel/src/prime_tunnel/tunnel.py
@@ -275,18 +275,7 @@
         if not self._started:
             return
 
-        if self._process is not None:
-            try:
-                self._process.terminate()
-                try:
-                    self._process.wait(timeout=5)
-                except subprocess.TimeoutExpired:
-                    self._process.kill()
-                    self._process.wait(timeout=2)
-            except Exception:
-                pass
-            finally:
-                self._process = None
+        self._kill_process()
 
         if self._tunnel_info is not None:
             try:
@@ -314,18 +303,7 @@
     async def _cleanup(self) -> None:
         """Clean up tunnel resources."""
         # Stop frpc process (this will cause drain threads to exit via EOF)
-        if self._process is not None:
-            try:
-                self._process.terminate()
-                try:
-                    self._process.wait(timeout=5)
-                except subprocess.TimeoutExpired:
-                    self._process.kill()
-                    self._process.wait(timeout=2)
-            except Exception:
-                pass
-            finally:
-                self._process = None
+        self._kill_process()
 
         # Delete tunnel registration
         if self._tunnel_info is not None:

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Comment thread packages/prime-tunnel/src/prime_tunnel/tunnel.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants