-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Problem description
We ran into two problematic issues with the StorageClass enum, both caused by the use of the EnumParseOverflowContainer:
1. Spelling errors become valid enum literals
For spelling errors, GetStorageClassForName will silently create new enum literals. Hence GetStorageClassForName() can not be relied upon to reject invalid storage class names, since it will instead turn those into meaningless, new literals. We had to write a wrapper around GetStorageClassForName() to avoid this problem in production.
2. Zero value (NOT_SET) is not recognized
The NOT_SET literal (0) is a valid enum value. It is returned by functions such as GetStorageClass() for {Head,Get}ObjectResult, but is not recognized by GetNameForStorageClass(). This causes logs to be filled up with misleading warnings:
[ERROR] 2023-10-03 22:08:39.546 EnumParseOverflowContainer [140211060084736] Could not find a previously stored overflow value for hash 0. This will likely break some requests.
What to do
Please
- Disable the use of
EnumParseOverflowContainerfor theStorageClassenum and related enums. The documentation says it fixes a "round trip" problem, but the present solution can silently introduce bugs and inconsistencies. - Should that not be possible, add support for
NOT_SETinGetNameForStorageClass(), to not reject a valid literal.
AWS CPP SDK version used
1.11x
Compiler and Version used
clang11
Operating System and version
Linux ubuntu 22.04