Skip to content

Commit

Permalink
refactor: Increase RPC timeout to 2 minutes
Browse files Browse the repository at this point in the history
- Increased the timeout for all RPC calls from various durations (30 seconds, 60 seconds) to a consistent 2 minutes.
- This change improves the robustness of the system by allowing more time for long-running operations to complete successfully.

Co-authored-by: Luigi  <[email protected]>
  • Loading branch information
Mahmoud-Emad and MarioBassem committed Jan 1, 2025
1 parent 5f2c880 commit 7c700eb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions griddriver/rmb.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func rmbCall(c *cli.Context, client *peer.RpcClient) (interface{}, error) {
cmd := c.String("cmd")
payload := c.String("payload")

ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
defer cancel()

var pl interface{}
Expand All @@ -82,7 +82,7 @@ func rmbCall(c *cli.Context, client *peer.RpcClient) (interface{}, error) {
func deploymentChanges(c *cli.Context, client *peer.RpcClient) (interface{}, error) {
dst := uint32(c.Uint("dst"))
contractID := c.Uint64("contract_id")
ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
defer cancel()
var changes []gridtypes.Workload
args := rmbCmdArgs{
Expand All @@ -102,7 +102,7 @@ func deploymentChanges(c *cli.Context, client *peer.RpcClient) (interface{}, err
func deploymentDeploy(c *cli.Context, client *peer.RpcClient) (interface{}, error) {
dst := uint32(c.Uint("dst"))
data := c.String("data")
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
defer cancel()

var dl gridtypes.Deployment
Expand All @@ -122,7 +122,7 @@ func deploymentGet(c *cli.Context, client *peer.RpcClient) (interface{}, error)
dst := uint32(c.Uint("dst"))
data := c.String("data")

ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
defer cancel()

var args rmbCmdArgs
Expand All @@ -147,7 +147,7 @@ func nodeTakenPorts(c *cli.Context, client *peer.RpcClient) (interface{}, error)
dst := uint32(c.Uint("dst"))
var takenPorts []uint16

ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
defer cancel()

if err := client.Call(ctx, dst, "zos.network.list_wg_ports", nil, &takenPorts); err != nil {
Expand All @@ -163,7 +163,7 @@ func nodeTakenPorts(c *cli.Context, client *peer.RpcClient) (interface{}, error)

func getNodePublicConfig(c *cli.Context, client *peer.RpcClient) (interface{}, error) {
dst := uint32(c.Uint("dst"))
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
defer cancel()

var pubConfig struct {
Expand Down

0 comments on commit 7c700eb

Please sign in to comment.