Skip to content

Commit

Permalink
Revert "Fix batchCallBuffer timeout handling"
Browse files Browse the repository at this point in the history
This reverts commit 5061259.

Timeout handling for batches was improved upstream in this PR
ethereum/go-ethereum#26681 which will be merged
in in the next commit. Reverting this commit to make the merge cleaner.
  • Loading branch information
Tristan-Wilson committed Aug 3, 2023
1 parent a07ccaf commit 0f1170e
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions rpc/handler.go
Expand Up @@ -158,14 +158,7 @@ func (b *batchCallBuffer) timeout(ctx context.Context, conn jsonWriter) {
for _, msg := range b.calls {
if !msg.isNotification() {
resp := msg.errorResponse(&internalServerError{errcodeTimeout, errMsgTimeout})
serialized, err := json.Marshal(resp)
if err != nil {
conn.writeJSON(ctx, errorMessage(&parseError{"error serializing timeout error: " + err.Error()}), true)
b.wrote = true
return
}

b.resp = append(b.resp, serialized)
b.resp = append(b.resp, resp)
}
}
b.doWrite(ctx, conn, true)
Expand Down Expand Up @@ -237,7 +230,7 @@ func (h *handler) handleBatch(msgs []*jsonrpcMessage) {
resp := h.handleCallMsg(cp, msg)
err := callBuffer.pushResponse(resp)
if err != nil {
h.conn.writeJSON(cp.ctx, errorMessage(err), true)
h.conn.writeJSON(cp.ctx, errorMessage(err))
return
}
}
Expand Down

0 comments on commit 0f1170e

Please sign in to comment.