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: standby meta server exits abnormally with core dump after receiving the http request /meta/cluster #1816

Merged
merged 3 commits into from
Dec 25, 2023

Conversation

empiredan
Copy link
Contributor

@empiredan empiredan commented Dec 22, 2023

#1817

If meta server is built without testing(i.e. ./run.sh build without --test),
the macro MOCK_TEST dedicated to test code should not be enabled,
which might lead to unexpected behaviors.

On the other hand, meta server should not exit abnormally with core
dump even if it is built for testing(i.e. ./run.sh build --test). Once it
finds that balancer is not initialized by mocking, it should go through
the normal process to prevent from core dump.

… fix meta server coredump due to null pointer to balancer
@empiredan empiredan added the type/bug-fix This PR fixes a bug. label Dec 22, 2023
@empiredan empiredan changed the title fix: define DSN_MOCK_TEST only while building Pegasus for testing and fix meta server core dump due to null pointer to balancer fix: standby meta server exits abnormally with core dump after receiving http request "/meta/cluster" Dec 22, 2023
@empiredan empiredan changed the title fix: standby meta server exits abnormally with core dump after receiving http request "/meta/cluster" fix: standby meta server exits abnormally with core dump after receiving the http request /meta/cluster Dec 22, 2023
#ifdef DSN_MOCK_TEST
return true;
#ifdef MOCK_TEST
// Once MOCK_TEST is defined, the meta server must has been built with `./run.sh build --test`.
Copy link
Member

Choose a reason for hiding this comment

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

It would be better to say BUILD_TEST or MOCK_TEST is enabled, because it's possible to build by cmake directly, not using ./run.sh build.

@empiredan empiredan merged commit a397c07 into apache:master Dec 25, 2023
78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants