-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
create_scheduling_group / scheduling_group_key_create not exception safe when SG key data constructor throws #2222
Comments
mlitvk
added a commit
to mlitvk/seastar
that referenced
this issue
Jan 15, 2025
Improve handling of exceptions during scheduling group and scheduling group key creation, where a user-provided constructor for the keys may fail, for example. We use a new struct `specific_val` and smart pointers to manage memory allocation, construction and destruction of scheduling group data in a safe manner. We also reorder the initialization order to make it safer. For example, when creating a scheduling group, first allocate all data and then swap it into the scheduling group's data structure. Fixes scylladb#2222
mlitvk
added a commit
to mlitvk/seastar
that referenced
this issue
Jan 15, 2025
Improve handling of exceptions during scheduling group and scheduling group key creation, where a user-provided constructor for the keys may fail, for example. We use a new struct `specific_val` and smart pointers to manage memory allocation, construction and destruction of scheduling group data in a safe manner. We also reorder the initialization order to make it safer. For example, when creating a scheduling group, first allocate all data and then swap it into the scheduling group's data structure. Fixes scylladb#2222
mlitvk
added a commit
to mlitvk/seastar
that referenced
this issue
Jan 15, 2025
Improve handling of exceptions during scheduling group and scheduling group key creation, where a user-provided constructor for the keys may fail, for example. We use a new struct `specific_val` and smart pointers to manage memory allocation, construction and destruction of scheduling group data in a safe manner. We also reorder the initialization order to make it safer. For example, when creating a scheduling group, first allocate all data and then swap it into the scheduling group's data structure. Fixes scylladb#2222
mlitvk
added a commit
to mlitvk/seastar
that referenced
this issue
Jan 15, 2025
Improve handling of exceptions during scheduling group and scheduling group key creation, where a user-provided constructor for the keys may fail, for example. We use a new struct `specific_val` and smart pointers to manage memory allocation, construction and destruction of scheduling group data in a safe manner. We also reorder the initialization order to make it safer. For example, when creating a scheduling group, first allocate all data and then swap it into the scheduling group's data structure. Fixes scylladb#2222
mlitvk
added a commit
to mlitvk/seastar
that referenced
this issue
Jan 16, 2025
Improve handling of exceptions during scheduling group and scheduling group key creation, where a user-provided constructor for the keys may fail, for example. We use a new struct `specific_val` and smart pointers to manage memory allocation, construction and destruction of scheduling group data in a safe manner. We also reorder the initialization order to make it safer. For example, when creating a scheduling group, first allocate all data and then swap it into the scheduling group's data structure. Fixes scylladb#2222
mlitvk
added a commit
to mlitvk/seastar
that referenced
this issue
Jan 21, 2025
Improve handling of exceptions during scheduling group and scheduling group key creation, where a user-provided constructor for the keys may fail, for example. We use a new struct `specific_val` and smart pointers to manage memory allocation, construction and destruction of scheduling group data in a safe manner. We also reorder the initialization order to make it safer. For example, when creating a scheduling group, first allocate all data and then swap it into the scheduling group's data structure. Fixes scylladb#2222
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are two cases where data for a scheduling group key can be constructed:
create_scheduling_group
)scheduling_group_key_create
)In both cases, the SG key data constructor can fail. This is an example test for the second case:
Even though the constructor of
thrower
always throws, its destructor is called anyway:It looks like both functions are not exception safe and cause issues later if the SG key data constructor fails with an exception. I believe that both operations should be able to roll back in case of an exception.
The text was updated successfully, but these errors were encountered: