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

jetstream liveness check interval is too short and it should be configurable. #11

Open
itaru2622 opened this issue Oct 20, 2024 · 0 comments · May be fixed by #12
Open

jetstream liveness check interval is too short and it should be configurable. #11

itaru2622 opened this issue Oct 20, 2024 · 0 comments · May be fixed by #12

Comments

@itaru2622
Copy link

as described in bluesky-social/atproto#2901,

When I tested jetstream in selfhosting env, It restarts every 15 seconds.

it caused by below part:

// Start a goroutine to manage the liveness checker, shutting down if no events are received for 15 seconds
shutdownLivenessChecker := make(chan struct{})
livenessCheckerShutdown := make(chan struct{})
go func() {
ticker := time.NewTicker(15 * time.Second)
lastSeq := int64(0)
log := log.With("source", "liveness_checker")
for {
select {
case <-shutdownLivenessChecker:
log.Info("shutting down liveness checker")
close(livenessCheckerShutdown)
return
case <-ticker.C:
seq, _ := c.Progress.Get()
if seq == lastSeq && seq != 0 {
log.Error("no new events in last 15 seconds, shutting down for docker to restart me", "seq", seq)
close(livenessKill)

15 seconds may be suitable when it serving whole world with lots of users, but not for other cases.
so it should be configurable.

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 a pull request may close this issue.

1 participant