Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for retries and timeout #130

Open
Purushottamlpa opened this issue Sep 28, 2020 · 4 comments
Open

Support for retries and timeout #130

Purushottamlpa opened this issue Sep 28, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@Purushottamlpa
Copy link

Hi,

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

@github-actions
Copy link

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.

@jeroenrinzema
Copy link
Contributor

👋 @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.

@jeroenrinzema jeroenrinzema added enhancement New feature or request hacktoberfest labels Sep 29, 2020
@Purushottamlpa
Copy link
Author

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.

@jeroenrinzema
Copy link
Contributor

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{},
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants