Skip to content

Commit

Permalink
Avoid scary logs for normal ish stream close
Browse files Browse the repository at this point in the history
  • Loading branch information
jackkleeman committed Jul 8, 2024
1 parent 0476a79 commit b7c8fd4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions internal/state/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/restatedev/sdk-go/generated/proto/protocol"
"github.com/restatedev/sdk-go/internal/wire"
"golang.org/x/net/http2"
"google.golang.org/protobuf/proto"
)

Expand Down Expand Up @@ -150,9 +151,15 @@ func (m *Machine) handleCompletionsAcks() {
for {
msg, err := m.protocol.Read()
if err != nil {
if !errors.Is(err, io.EOF) {
m.log.Error().Err(err).Msg("issue reading completions & acks")
if errors.Is(err, io.EOF) {
return
}
var t *http2.StreamError
if errors.As(err, &t) && t.Code == http2.ErrCodeNo {
// normal close
return
}
m.log.Error().Err(err).Msg("issue reading completions & acks")
return
}
switch msg.Type() {
Expand Down

0 comments on commit b7c8fd4

Please sign in to comment.