jexia / semaphore

Take control of your data, connect with anything, and expose it anywhere through protocols such as HTTP, GraphQL, and gRPC.

Home Page:https://jexia.github.io/semaphore/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for retries and timeout

Purushottamlpa opened this issue · comments

Hi,

Is there support for retry and orchestrator side timeout option available in Semaphore?

Hello @Purushottamlpa, thank you for your interest in our work!

If this is a bug report, please provide the minimum viable code and steps to reproduce your issue, otherwise we can not help you.
When submitting a new feature request or suggestion please make sure to check for duplicate issues.

👋 @Purushottamlpa, Thank you for submitting your issue. Currently is there no retry functionallity build into Semaphore. Flow retries could be implemented through middleware. Could you maybe elaborate a little bit on why you need this feature?

Orchestrator side timeout

It is possible to set request duration timeouts inside the listeners. There is currently no possibility of defining a custom timeout for a specific flow.

Thanks @jeroenrinzema. My query is within in a flow, if an HTTP call fails, is there any inbuilt support to put a delay in flow and retry failed service with configurable delay.

Hi @Purushottamlpa, There is currently no built-in support for such use-case. It should be possible to implement this inside the node caller (https://github.com/jexia/semaphore/blob/master/pkg/flow/caller.go#L77-L90). An additional option has to be introduced inside the specs.Node. This option should be populated inside the HCL syntax to configure the retry policy.

// ParseIntermediateNode parses the given intermediate call to a spec call
func ParseIntermediateNode(ctx *broker.Context, dependencies specs.Dependencies, node Resource) (*specs.Node, error) {
call, err := ParseIntermediateCall(ctx, node.Request)
if err != nil {
return nil, err
}
rollback, err := ParseIntermediateCall(ctx, node.Rollback)
if err != nil {
return nil, err
}
result := specs.Node{
Type: specs.NodeIntermediate,
DependsOn: make(specs.Dependencies, len(node.DependsOn)),
ID: node.Name,
Name: node.Name,
Call: call,
ExpectStatus: node.ExpectStatus,
Rollback: rollback,
OnError: &specs.OnError{},
}