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

Kinesis getRecords request is timing out. #2971

Closed
yolossn opened this issue Nov 25, 2019 · 4 comments
Closed

Kinesis getRecords request is timing out. #2971

yolossn opened this issue Nov 25, 2019 · 4 comments

Comments

@yolossn
Copy link

yolossn commented Nov 25, 2019

Please fill out the sections below to help us address your issue.

Version of AWS SDK for Go?

v1.23.5

Version of Go (go version)?

golang:1.12.4

What issue did you see?

Sometimes the GetRecords fails with the following error message: send request failed
The Aws original error thrown is: Post https://kinesis.********.amazonaws.com/: dial tcp **.***.***.***:***: i/o timeout

Even after 3 retries the response is the same. Right now whenever this error occurs I have to re-establish the connection to kinesis to solve this.

Steps to reproduce

Straight forward example. Create a connection and use getRecords function to fetch the records.

If you have an runnable example, please include it.

@diehlaws diehlaws self-assigned this Nov 25, 2019
@diehlaws
Copy link
Contributor

Hi @yolossn, thanks for reaching out to us. Can you provide a code sample showing the parameters being used when initializing your service client, and how you're issuing your getRecords calls? Knowing whether goroutines are being used for these calls would be helpful.

Are you interacting with Kinesis within a given AWS region (if so, which one?), or are you using a local variant of Kinesis such as localstack or Kinesalite when you see this behavior? Where is the host that is executing Kinesis API calls via the AWS SDK for Go relative to the service endpoint being used? Can you adjust your error handling to attempt a connection to the endpoint in a way that does not use the SDK (e.g. using exec to call something like netcat, or net.Dial to check the port's availability on the endpoint) to check whether the behavior is exclusive to the SDK or if it occurs on the host regardless of the SDK's involvement?

@diehlaws diehlaws added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Nov 25, 2019
@yolossn
Copy link
Author

yolossn commented Nov 25, 2019

Hey @diehlaws

Here is a code sample of how I initialize the client.

func SetupKinesis(AWSAccessKey string, AWSSecretAccessKey string, AWSRegion string) (*kinesis.Kinesis, error) {

	cred := credentials.NewStaticCredentials(AWSAccessKey, AWSSecretAccessKey, "")

	awsConfig := aws.Config{
		Region:      aws.String(AWSRegion),
		Credentials: cred,
	}

	sess, err := session.NewSession(&awsConfig)
	if err != nil {
		return nil, err
	}

	client := kinesis.New(sess)

	return client, nil
}

Yes goroutines are used to getRecords from each shard in the stream. The AWS region is ap-south-1. The host making this calls is from GCP Asia-South-1 mumbai region. I will try adjusting the error to make an attempt to connect to the endpoint. As I mentioned earlier I retry 3 times in case of an error, sometimes I get back the results but sometimes the retry doesn't help and have to reestablish the connection to get it working.

@yolossn
Copy link
Author

yolossn commented Dec 5, 2019

@diehlaws Any update on this ?

@diehlaws diehlaws removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Mar 9, 2020
@diehlaws diehlaws removed their assignment Aug 26, 2020
@yolossn yolossn closed this as completed Dec 15, 2020
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

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.

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

No branches or pull requests

2 participants