Skip to content

[TON-365] Connection force disconnect#197

Open
g3co wants to merge 6 commits intomasterfrom
feature/TON-365_force-disconnect
Open

[TON-365] Connection force disconnect#197
g3co wants to merge 6 commits intomasterfrom
feature/TON-365_force-disconnect

Conversation

@g3co
Copy link
Copy Markdown
Contributor

@g3co g3co commented Mar 23, 2026

Force-close SSE connections after a configurable maximum lifetime to improve load balancing across bridge instances. Without this, clients stay pinned to a single backend indefinitely, causing uneven load distribution.

  • Connections are closed after SSE_MAX_LIFETIME (default 2h) plus a random jitter of up to SSE_MAX_LIFETIME_JITTER (default 15min)
  • Each connection gets its own independent jitter so they don't all drop at once
  • Clients using EventSource auto-reconnect with Last-Event-ID, so no messages are lost

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 23, 2026

📊 Performance Metrics

Performance Metrics (memory storage)

  • CPU: 0.76s (4 cores) • Goroutines: 8 • Threads: 8
  • Memory: 14.0MB heap • 47.8MB RAM • 38.5MB total • 240013 allocs
  • GC: 11 cycles (0.75ms avg)
  • FDs: 9/65536 (0.0%)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 23, 2026

📊 Performance Metrics

Performance Metrics (postgres storage)

  • CPU: 0.91s (4 cores) • Goroutines: 10 • Threads: 9
  • Memory: 19.5MB heap • 58.9MB RAM • 40.7MB total • 266861 allocs
  • GC: 10 cycles (0.58ms avg)
  • FDs: 35/65536 (0.1%)

g3co added 2 commits March 23, 2026 12:33
…ure. Added internal and tonmetrics directories to Docker context. Updated test function names for consistency and improved documentation in bridge SSE tests.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 23, 2026

📊 Performance Metrics

Performance Metrics (cluster-valkey storage)

  • CPU: 0.71s (4 cores) • Goroutines: 11 • Threads: 9
  • Memory: 24.7MB heap • 56.4MB RAM • 37.3MB total • 300306 allocs
  • GC: 9 cycles (0.82ms avg)
  • FDs: 71/65536 (0.1%)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 23, 2026

📊 Performance Metrics

Performance Metrics (nginx storage)

  • CPU: 0.11s (4 cores) • Goroutines: 6 • Threads: 5
  • Memory: 1.2MB heap • 23.2MB RAM • 1.2MB total • 5902 allocs
  • GC: 0 cycles (0ms avg)
  • FDs: 15/65536 (0.0%)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 23, 2026

📊 Performance Metrics

Performance Metrics (dnsmasq storage)

  • CPU: 0.27s (4 cores) • Goroutines: 11 • Threads: 8
  • Memory: 6.3MB heap • 29.8MB RAM • 13.1MB total • 67973 allocs
  • GC: 6 cycles (0.46ms avg)
  • FDs: 60/65536 (0.1%)

@g3co g3co changed the title [TON-365] Add SSE connection lifetime management and antiscam domain filtering … [TON-365] Connection force disconnect Mar 23, 2026
@g3co g3co requested a review from TrueCarry March 25, 2026 09:28
Comment thread internal/v3/handler/handler.go Outdated
@g3co g3co requested a review from TrueCarry March 30, 2026 07:24
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