+
Skip to content

gRPC timeout blocked context #55

Open
@APPLECHOI

Description

@APPLECHOI

Bug description

The chain may not respond when the resource is not ready. If you don't set a timeout to context, the context would possibly block forever.
Therefore, the parsing stops.

Steps to reproduce

Parse the latest block with only parse missing block option.

Expected behavior

The system should retry when there is a timeout.

Implementation Proposal

At https://github.com/forbole/juno/blob/3b5d944a0def1b47ae695422748c63d263833779/node/remote/node.go
It should set Exponential backoff for timeout and use a new context every time when the chain node grpc endpoint is called
Example:

ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
transaction, err := cp.flowClient.GetTransaction(ctx, txID)
cancel()

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载