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

fix(sdk): cloud.Queue is not FIFO by default #4173

Merged
merged 6 commits into from
Sep 14, 2023
Merged

Conversation

Chriscbr
Copy link
Contributor

Related to #3897

We have a flakey test in our CI that validates part of the functionality of cloud.Queue. It turns out, our test was assuming that the queue messages are received in FIFO order (first-in-first-out), which wasn't something we meant to guarantee (see the original issue about queue.pop() here). This PR fixes the test, and updates the simulator implementation to reflect the fact that messages can be received out of order.

(Why not FIFO by default? For many distributed apps, the exact order of messages isn't critical, and relaxing this constraint makes it easier to handle higher throughputs of messages. That said, adding a fifo option to cloud.Queue would be reasonable as a future enhancement)

Checklist

  • Title matches Winglang's style guide
  • Description explains motivation and solution
  • Tests added (always)
  • Docs updated (only required for features)
  • Added pr/e2e-full label if this feature requires end-to-end testing

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

@monadabot
Copy link
Contributor

monadabot commented Sep 13, 2023

Console preview environment is available at https://wing-console-pr-4173.fly.dev 🚀

Updated (UTC): 2023-09-13 15:39

@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Sep 13, 2023
@staycoolcall911 staycoolcall911 removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Sep 13, 2023
Copy link
Contributor

@hasanaburayyan hasanaburayyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind adding a quick snippet to https://www.winglang.io/docs/standard-library/cloud/queue about queues not being FIFO?

I was going to open a PR but wonder if we can just sneak it in here? I dont mind doing it separately either.

@Chriscbr
Copy link
Contributor Author

@hasanaburayyan good idea - done 👍

@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Sep 13, 2023
@garysassano
Copy link
Collaborator

That said, adding a fifo option to cloud.Queue would be reasonable as a future enhancement

Wouldn't it be better to add this option already? So we can reuse existing code instead of eliminating it.

@staycoolcall911 staycoolcall911 removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Sep 14, 2023
@mergify
Copy link
Contributor

mergify bot commented Sep 14, 2023

Thanks for contributing, @Chriscbr! This PR will now be added to the merge queue, or immediately merged if rybickic/fix-queue-sim is up-to-date with main and the queue is empty.

mergify bot added a commit that referenced this pull request Sep 14, 2023
@mergify mergify bot merged commit eb9f00f into main Sep 14, 2023
14 checks passed
@mergify mergify bot deleted the rybickic/fix-queue-sim branch September 14, 2023 13:02
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.30.7.

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

Successfully merging this pull request may close these issues.

5 participants