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

chore: change Namespaces to be a global pointer #4032

Merged
merged 2 commits into from
Nov 10, 2024
Merged

chore: change Namespaces to be a global pointer #4032

merged 2 commits into from
Nov 10, 2024

Conversation

romange
Copy link
Collaborator

@romange romange commented Oct 31, 2024

Before the namespaces object was defined globally. However it has non-trivial d'tor that is being called after main exits. It's quite dangerous to have global non-POD objects being defined globally. For example, if we used LOG(INFO) inside the Clear function , that would crash dragonfly on exit.

Ths PR changes it to be a global pointer.

chakaz
chakaz previously approved these changes Nov 10, 2024
src/server/engine_shard_set.cc Show resolved Hide resolved
src/server/rdb_save.cc Outdated Show resolved Hide resolved
chakaz
chakaz previously approved these changes Nov 10, 2024
Before the namespaces object was defined globally.
However it has non-trivial d'tor that is being called after main exits.
It's quite dangerous to have global non-POD objects being defined globally.
For example, if we used LOG(INFO) inside the Clear function , that would crash dragonfly on exit.

Ths PR changes it to be a global pointer.

Signed-off-by: Roman Gershman <[email protected]>
@romange
Copy link
Collaborator Author

romange commented Nov 10, 2024

Rebased due to conflicts

@romange romange enabled auto-merge (squash) November 10, 2024 10:39
@romange romange merged commit be96e6c into main Nov 10, 2024
12 checks passed
@romange romange deleted the Pr3 branch November 10, 2024 10:45
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.

3 participants