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 example VisibilityTimeout value too low #3652

Closed
HJTP opened this issue Apr 4, 2023 · 8 comments
Closed

SQS example VisibilityTimeout value too low #3652

HJTP opened this issue Apr 4, 2023 · 8 comments
Assignees
Labels
documentation This is a problem with documentation. feature-request This issue requests a feature. p3 This is a minor priority issue sqs

Comments

@HJTP
Copy link

HJTP commented Apr 4, 2023

Describe the issue

On this SQS example page:

https://boto3.amazonaws.com/v1/documentation/api/latest/guide/sqs-example-sending-receiving-msgs.html

The VisibilityTimeout for the receive-and-delete example is set to 0. However, a message must be deleted within its visibility window. If the window is set to 0, it must be deleted within the same millisecond, as per the AWS docs. This code cannot reliably achieve this. Therefore, I'd propose setting the VisibilityTimeout to a value like 5 seconds:
VisibilityTimeout=5,

Links

https://boto3.amazonaws.com/v1/documentation/api/latest/guide/sqs-example-sending-receiving-msgs.html

@HJTP HJTP added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Apr 4, 2023
@RyanFitzSimmonsAK RyanFitzSimmonsAK self-assigned this Apr 4, 2023
@RyanFitzSimmonsAK RyanFitzSimmonsAK added sqs needs-review p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Apr 4, 2023
@RyanFitzSimmonsAK
Copy link
Contributor

Hi @HJTP, thanks for reaching out. I spoke to someone on the team, and they pointed out that 0 is a valid value for that field, and that the example isn't intended to work off-the-shelf. I think an improvement that would help more people would be adding the details about VisibilityTimeout=0 to the guide that you linked. I think that strikes more at the actual issue of that information being harder to find than it should be. There's even a section titled 'Managing visibility timeout in Amazon SQS' that it should probably go under. Thoughts?

@RyanFitzSimmonsAK RyanFitzSimmonsAK added response-requested Waiting on additional information or feedback. and removed needs-review labels Apr 19, 2023
@HJTP
Copy link
Author

HJTP commented Apr 23, 2023

Hi @RyanFitzSimmonsAK , thanks for the reply! Firstly, I must add that my comment only applies for FIFO queues. For normal queues, the example code might work (I have not tested this).

Regarding your proposal: good idea! Is there some kind of "important note" type of text block we could use for this caveat?

@github-actions github-actions bot removed the response-requested Waiting on additional information or feedback. label Apr 23, 2023
@RyanFitzSimmonsAK
Copy link
Contributor

RyanFitzSimmonsAK commented Apr 25, 2023

Yep, an example of an important note can be found on this page. This note basically contains all the information we need, so it's just a matter of adding it to the boto3 docs.

@HJTP
Copy link
Author

HJTP commented Apr 25, 2023

@RyanFitzSimmonsAK OK! Do I do that or you?

@RyanFitzSimmonsAK
Copy link
Contributor

That's something for me to bring up internally, which I've already done. Thanks again for raising this issue, I'll update you here once some progress has been made!

@RyanFitzSimmonsAK RyanFitzSimmonsAK added the feature-request This issue requests a feature. label Apr 26, 2023
@HJTP
Copy link
Author

HJTP commented May 1, 2023

You're welcome! While you're at it, I just found another one.
On this page: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sqs/client/receive_message.html
It says
MaxNumberOfMessages=123,

While valid values are 1-10. Not a big deal, but might as well use a valid value as the example, right?

@RyanFitzSimmonsAK
Copy link
Contributor

The Boto3 SQS user guide links to the SQS developer guide, which discussed the consequences of setting VisibilityTimeout=0.

Terminating the timeout – If you decide not to process a received message, you can terminate its visibility timeout by setting the VisibilityTimeout to 0 seconds through the ChangeMessageVisibility action. This immediately makes the message available for other consumers to process.

Closing this issue.

Copy link

github-actions bot commented Sep 4, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This is a problem with documentation. feature-request This issue requests a feature. p3 This is a minor priority issue sqs
Projects
None yet
Development

No branches or pull requests

2 participants