Skip to content

feat: add restart_count to HostInfo proto#232

Merged
jhaynie merged 1 commit intomainfrom
fix/hostinfo-restart-count
Apr 19, 2026
Merged

feat: add restart_count to HostInfo proto#232
jhaynie merged 1 commit intomainfrom
fix/hostinfo-restart-count

Conversation

@jhaynie
Copy link
Copy Markdown
Member

@jhaynie jhaynie commented Apr 19, 2026

Summary

Adds restart_count (uint32, field 14) to the HostInfo protobuf message so hadron can report its systemd restart counter during the session hello.

Why

We discovered hadron-s6xljlx8 in us-west crash-looping every ~5 minutes (restart counter at 25+) due to a false-positive stall detection bug on idle machines with 0 containers. The companion hadron PR fixes the stall detection, but we need visibility into restart counts via the ion debug API so we can detect crash loops during health checks without SSH'ing into individual machines.

Changes

  • gravity_session.proto: Added uint32 restart_count = 14 to HostInfo
  • gravity_session.pb.go: Regenerated
  • gravity/grpc_client.go: Populates RestartCount from GravityConfig
  • gravity/types.go: Added RestartCount uint32 to GravityConfig

Backward compatible — old hadrons send 0 (proto default), new hadrons send the systemd NRestarts value.

Summary by CodeRabbit

  • New Features
    • Enhanced system monitoring: Hosts now automatically track and report restart count information to the server during session initialization. This provides improved diagnostic capabilities to identify potential crash-loop conditions, better monitor system stability patterns, enhance operational troubleshooting workflows, and deliver more comprehensive visibility into overall platform health and reliability metrics.

Add restart_count field (uint32, field 14) to the HostInfo protobuf
message. This allows hadron to report its systemd restart counter
to ion during the session hello, enabling crash-loop detection in
the debug machines endpoint.

- gravity_session.proto: added restart_count = 14
- gravity_session.pb.go: regenerated
- grpc_client.go: populate RestartCount from GravityConfig
- types.go: added RestartCount to GravityConfig
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 19, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3c5c2734-b785-489e-8c85-264797290fa7

📥 Commits

Reviewing files that changed from the base of the PR and between c798697 and 6ab2729.

⛔ Files ignored due to path filters (1)
  • gravity/proto/gravity_session.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (3)
  • gravity/grpc_client.go
  • gravity/proto/gravity_session.proto
  • gravity/types.go

📝 Walkthrough

Walkthrough

Added systemd restart counter support throughout the codebase. A new RestartCount field is added to GravityConfig type, the protobuf schema gains the corresponding field, and the gRPC client populates this field when sending host information.

Changes

Cohort / File(s) Summary
Systemd Restart Counter Support
gravity/types.go, gravity/proto/gravity_session.proto, gravity/grpc_client.go
Added RestartCount field to GravityConfig struct, extended HostInfo protobuf message with restart_count field (field 14), and updated getHostInfo function to populate this field in host metadata sent to server.

Comment @coderabbitai help to get the list of available commands and usage tips.

@jhaynie jhaynie merged commit a3221e8 into main Apr 19, 2026
3 of 4 checks passed
@jhaynie jhaynie deleted the fix/hostinfo-restart-count branch April 19, 2026 23:52
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.

1 participant