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

Guard check that event_base_new initializes correctly #12218

Merged
merged 5 commits into from
Jul 30, 2020
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion source/common/event/libevent_scheduler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ void recordTimeval(Stats::Histogram& histogram, const timeval& tv) {
}
} // namespace

LibeventScheduler::LibeventScheduler() : libevent_(event_base_new()) {
LibeventScheduler::LibeventScheduler() {
event_base* eventBase = event_base_new();
Copy link
Member

Choose a reason for hiding this comment

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

I believe @jmarantz was requesting the variable eventBase be snake cased to event_base (#12218 (comment))

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks totally missed this one

RELEASE_ASSERT(eventBase != nullptr, "Failed to initialize libevent event_base");
libevent_ = Libevent::BasePtr(eventBase);

// The dispatcher won't work as expected if libevent hasn't been configured to use threads.
RELEASE_ASSERT(Libevent::Global::initialized(), "");
}
Expand Down