Closed abhinavsingh-swiggy closed 1 year ago
Hi @abhinavsingh-swiggy thanks for reaching out. Do you have the full code of how you use StartExecution
API? I have some similar code with Retryer but it is not reproducing the same behavior as you mentioned above.
const profile, region = "default", "us-west-2"
ctx := context.Background()
cfg, err := config.LoadDefaultConfig(ctx,
config.WithRegion(region),
config.WithSharedConfigProfile(profile),
config.WithRetryer(func() aws.Retryer {
return retry.AddWithMaxAttempts(retry.NewStandard(), 5)
}),
)
if err != nil {
return fmt.Errorf("failed to load aws credentials: %w", err)
}
caller, err := sts.NewFromConfig(cfg).
GetCallerIdentity(ctx, new(sts.GetCallerIdentityInput))
if err != nil {
return fmt.Errorf("failed to retrieve caller identity: %w", err)
}
fmt.Println("CALLER:", aws.ToString(caller.Arn))
Please confirm again if this is persisting with the latest version of SDK also.
Hi @vudh1 the behaviour is seen with a nil retryer for any API. In your code, you have a non-nil retryer. Also: retryer must be set to nil not in the function options for creating the config, but the function options for creating the client.
Refer the code I have written in the Description
, and use it to create your client.
Retryer
is a required config - the intended way to disable retries is via aws.NopRetryer.
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the bug
The SDK Client is set up as below:
The client gets created successfully. But upon calling the StartExecution API, the process panics.
Expected Behavior
The process should not panic; it should successfully start the execution. Also, in the event of any error, the process should not be retried.
Current Behavior
Currently, the process returns segmentation fault. I am pasting the stack trace below:
Reproduction Steps
Please use the created client as described in the first section to call
StartExecution
API on any state machine.Possible Solution
No response
Additional Information/Context
While I understand that having retries is good to have, probably must. But I was working on something which needed limited or no retries, and came across this.
I can also go with my own implementation of the
Retryer
interface to obtain a limited or no retry retrier. But perhaps writing that implementation feels a bit tedious when I actually want no retries at all. Sincenil
was also a valid value to provide to theRetryer
in theOptions
, I first went with that and found this issue.(On a side note, the
aws-sdk-go-v1
does not even provide an option to set the Retryer as nil. It always creates a default retryer and attaches to the config.)AWS Go SDK version used
github.com/aws/aws-sdk-go-v2 v1.16.2; github.com/aws/aws-sdk-go-v2/config v1.15.3; github.com/aws/aws-sdk-go-v2/service/sfn v1.13.3
Compiler and Version used
go version go1.15.15 darwin/amd64
Operating System and version
macOS Catalina Version 10.15.7 (19H2)