SJTU-IPADS / ServerlessBench

A benchmark suite for serverless computing
Other
216 stars 32 forks source link

Issue with exactly-once execution semantic of alexa #6

Closed nhaorand closed 3 years ago

nhaorand commented 3 years ago

Serverless platforms retry failed instances and require programmers to guarantee exactly-once execution semantic of functions. However, I find that reminder/handler.js:addItem may not guarantee exactly-once execution semantic.

For example, I invoke addItem to associate book with work. At the beginning, book does not exist. If there is no failure, addItem will insert book and return "...appended items...". However, if addItem fails after inserting and before returning, then it will retry and return "...they already associated...". This issue can be triggered by inserting "throw 1111" at line 134.

The issue can be fixed by changing the return value speakOutput. It should be the same string in different execution paths.

Please let me know if my understanding of the code is incorrect. Thank you very much.

Ddnirvana commented 3 years ago

hi @nhaorand ,

Thanks for pointing out the issue. The confusing output you mentioned actually depends on the platform implementation (or policy) for re-try, and we believe it will not cause serious issues in the benchmark suite.

Nevertheless, @YellyYU has posed an PR #7 to resolve the issue. Please let me know whether the PR satisfies your needs and fixes the issue.

nhaorand commented 3 years ago

hi @Ddnirvana @YellyYU ,

Thanks for your reply. I have read the PR #7 and I think the function can satisfy exactly-once semantic now if it runs sequentially.

Ddnirvana commented 3 years ago

PR merged. Close the issue.