Skip to content

cacheOrchestratorStake not immediately returning upon timeout #1407

Open
@yondonfu

Description

@yondonfu

Describe the bug
A clear and concise description of what the bug is.

The cachOrchestratorStake function used to fetch the stake of orchs during discovery has a minor bug with how timeouts are handled.

Note that how we handle timeouts in [1] has a minor bug: the break applies to the innermost select (a weird design choice by golang IMO), and what happens is we may actually end up looping and hitting case <-ctx.Done() a few times until breaking out of the for-loop.

Expected behavior
A clear and concise description of what you expected to happen.

If a time out occurs the function should immediately return.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions