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

SQS client.receive_messages hangs when WaitTimeSeconds is not set #968

Closed
Brett55 opened this issue May 31, 2017 · 6 comments
Closed

SQS client.receive_messages hangs when WaitTimeSeconds is not set #968

Brett55 opened this issue May 31, 2017 · 6 comments

Comments

@Brett55
Copy link
Contributor

Brett55 commented May 31, 2017

Using version 1.0.0

I've found that with SQS client, calling client.receive_message() without WaitTimeSeconds param causes the statement to hang for a 5-10 mins before returning None. If I supply any WaitTimeSeconds param such as "20" it works fine.

Seems to related to this block https://github.com/spulec/moto/blob/master/moto/sqs/models.py#L346-L352

@Brett55
Copy link
Contributor Author

Brett55 commented Jun 1, 2017

Perhaps changing linee 346 to:

if result or (unix_time() > polling_end):

@JackDanger
Copy link
Collaborator

Fixed by @Brett55 in #969

@Brett55
Copy link
Contributor Author

Brett55 commented Jun 2, 2017

@JackDanger Wanted to contact you direct but this will have to suffice, I noticed that when I upgraded to version 1.0.0 of Moto, that tests are hitting AWS direct (SQS and SNS). I confirmed this by rolling back to 0.4.31 and master branch from github. I will look into this further, but I'd imagine this is not expected

@JackDanger
Copy link
Collaborator

@Brett55 That's a known but under-publicized change of Moto 1.0. What you need to do is replace @mock_sqs with @mock_sqs_deprecated (and same for other service) everywhere that Boto is used. @mock_sqs is now only for Boto3 support.

@Brett55
Copy link
Contributor Author

Brett55 commented Jun 2, 2017 via email

@JackDanger
Copy link
Collaborator

@Brett55 That's correct.

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