Skip to content

[aws-cpp-sdk-s3 / aws-cpp-sdk-s3-crt]: issues in StorageClass enum caused by EnumParseOverflowContainer #2694

@grrtrr

Description

@grrtrr

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

  1. Disable the use of EnumParseOverflowContainer for the StorageClass enum and related enums. The documentation says it fixes a "round trip" problem, but the present solution can silently introduce bugs and inconsistencies.
  2. Should that not be possible, add support for NOT_SET in GetNameForStorageClass(), 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

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.p2This is a standard priority issuepending-releaseThis issue will be fixed by an approved PR that hasn't been released yet.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions