Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support periodic ping to principal for keeping connection alive #288

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jparsai
Copy link
Collaborator

@jparsai jparsai commented Feb 4, 2025

This PR is to introduce a configurable periodic ping event to keep connection alive between agent and principal. The agent will send an event to principal after given interval, principal will not process this event and just acknowledge it. By default it is disabled and to enable it devs need to set value of agent-ping-interval in startup script or set env AGENT_PING_INTERVAL variable.

Fixes #171

@codecov-commenter
Copy link

codecov-commenter commented Feb 4, 2025

Codecov Report

Attention: Patch coverage is 0% with 35 lines in your changes missing coverage. Please review.

Project coverage is 48.29%. Comparing base (bc9011d) to head (c47dda6).

Files with missing lines Patch % Lines
agent/connection.go 0.00% 10 Missing ⚠️
internal/event/event.go 0.00% 9 Missing ⚠️
cmd/agent/main.go 0.00% 6 Missing ⚠️
agent/options.go 0.00% 5 Missing ⚠️
principal/event.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #288      +/-   ##
==========================================
- Coverage   48.55%   48.29%   -0.27%     
==========================================
  Files          73       73              
  Lines        6314     6349      +35     
==========================================
  Hits         3066     3066              
- Misses       2983     3018      +35     
  Partials      265      265              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chetan-rns
Copy link
Collaborator

gRPC has support for configuring keepalives. Do you think we should use it?

https://grpc.io/docs/guides/keepalive/

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.

Provide configurable keep-alive interval for event stream
3 participants