Wait out a forge not served for a moment when registering a build (novox/hq issue 486)
A registration asked the forge while node-tools re-served after a tool-runner rollout, heard "nothing serves gitea.gitea_api", and failed a good build's plan. The bus's not-served answer is now link.ErrNothingServes (and a timeout link.ErrNoAnswer), and the registration asks again for up to 90 s on those alone, never on a refusal; past the bound it fails saying how long it waited.
This commit is contained in:
@@ -206,8 +206,9 @@ func (b OverNATS) AskTool(ctx context.Context, module, tool string, args []byte,
|
||||
if err != nil {
|
||||
if errors.Is(err, nats.ErrNoResponders) {
|
||||
// Said at once rather than after the whole wait: nothing is subscribed to that
|
||||
// subject, which is a different fact from a tool being slow.
|
||||
return nil, fmt.Errorf("nothing serves %s.%s", module, tool)
|
||||
// subject, which is a different fact from a tool being slow. Said as ErrNothingServes, so an
|
||||
// asker can tell a tool not served now from one that refused (novox/hq issue 486).
|
||||
return nil, saidAs{fmt.Sprintf("nothing serves %s.%s", module, tool), ErrNothingServes}
|
||||
}
|
||||
return nil, fmt.Errorf("asking %s.%s: %w", module, tool, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user