Skip to content

Commit

Permalink
http timeouts (#1970)
Browse files Browse the repository at this point in the history
* fix: raise the http timeouts

I have a feeling this is preventing bufconnect to write the response sometimes, causing empty unary responses.
This could be the reason why our ratelimiting is flaky right now.

* refactor(cache): remove TODO comment in NewOtter function
fix(ratelimit): handle error and retry push pull operation in syncWithOrigin
  • Loading branch information
chronark authored Jul 24, 2024
1 parent 97c0470 commit fba45a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion apps/agent/pkg/cache/otter.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ func NewOtter[T any](config OtterConfig[T]) (Cache[T], error) {
go o.runRefreshing()

repeat.Every(time.Minute, func() {
// TODO: andreas replace with metrics
o.metrics.Record(CacheStats{
Resource: o.resource,
Size: o.cache.Size(),
Expand Down
7 changes: 6 additions & 1 deletion apps/agent/services/ratelimit/sync_with_origin.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ func (s *service) syncWithOrigin(req syncWithOriginRequest) {
if err != nil {
tracing.RecordError(span, err)
s.logger.Warn().Err(err).Interface("peer", peer).Str("peerId", peer.Id).Msg("failed to push pull")
return
res, err = c.PushPull(ctx, connectReq)
if err != nil {
tracing.RecordError(span, err)
s.logger.Error().Err(err).Str("peerId", peer.Id).Msg("failed to push pull again")
return
}
}

if len(req.events) != len(res.Msg.Updates) {
Expand Down

0 comments on commit fba45a3

Please sign in to comment.