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

Fix DBConfig used in builder #177

Merged
merged 3 commits into from
Oct 9, 2024
Merged

Fix DBConfig used in builder #177

merged 3 commits into from
Oct 9, 2024

Conversation

ZexiLiu
Copy link
Contributor

@ZexiLiu ZexiLiu commented Oct 4, 2024

No description provided.

/**
* DBConfig for the DB instance to be created.
*/
const DBConfig* dbConfig;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be DBConfig dbConfig, not pointer. The caller (of init) life span may not be longer than builder's life span.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the init() function, https://github.com/eBay/Jungle/pull/177/files#diff-e81fa7970a0833b1cb0b4bdbfadfefa84eaee52400bbf5d0b49d47bbe5474e63R121-R124

We already copy the passed in db_config to the dbConfig member of Builder, the pointer in this BuildParams will have the same life span as Builder.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, now I get it.

/**
* DBConfig for the DB instance to be created.
*/
const DBConfig* dbConfig;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, now I get it.

Copy link
Contributor

@greensky00 greensky00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, dbConfig should be initialized to null.

@ZexiLiu
Copy link
Contributor Author

ZexiLiu commented Oct 9, 2024

Wait, dbConfig should be initialized to null.

I change it from pointer to regular object so that BuilderParams will have a default db config.

@greensky00 greensky00 merged commit 5473c1b into eBay:master Oct 9, 2024
1 check passed
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.

2 participants