Skip to content

Commit 8e34f9e

Browse files
authored
event: bump libevent version to the latest (envoyproxy#12423)
On Windows, configure event-base to use wepoll backend instead of the default win32 backend. Risk Level: Low Testing: CI Docs Changes: N/A Release Notes: N/A Signed-off-by: Nick Grifka <[email protected]>
1 parent 0422f64 commit 8e34f9e

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

bazel/foreign_cc/BUILD

+1
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ envoy_cmake_external(
158158
name = "event",
159159
cache_entries = {
160160
"EVENT__DISABLE_OPENSSL": "on",
161+
"EVENT__DISABLE_MBEDTLS": "on",
161162
"EVENT__DISABLE_REGRESS": "on",
162163
"EVENT__DISABLE_TESTS": "on",
163164
"EVENT__LIBRARY_TYPE": "STATIC",

bazel/repository_locations.bzl

+7-5
Original file line numberDiff line numberDiff line change
@@ -233,18 +233,20 @@ DEPENDENCY_REPOSITORIES = dict(
233233
use_category = ["test"],
234234
),
235235
com_github_libevent_libevent = dict(
236-
sha256 = "c64156c24602ab7a5c66937d774cc55868911d5bbbf1650792f5877744b1c2d9",
236+
sha256 = "4c80e5fe044ce5f8055b20a2f141ee32ec2614000f3e95d2aa81611a4c8f5213",
237237
# This SHA includes the new "prepare" and "check" watchers, used for event loop performance
238238
# stats (see https://github.com/libevent/libevent/pull/793) and the fix for a race condition
239239
# in the watchers (see https://github.com/libevent/libevent/pull/802).
240240
# This also includes the fixes for https://github.com/libevent/libevent/issues/806
241241
# and https://github.com/lyft/envoy-mobile/issues/215.
242-
# This also include the fixes for Phantom events with EV_ET (see
242+
# This also includes the fixes for Phantom events with EV_ET (see
243243
# https://github.com/libevent/libevent/issues/984).
244+
# This also includes the wepoll backend for Windows (see
245+
# https://github.com/libevent/libevent/pull/1006)
244246
# TODO(adip): Update to v2.2 when it is released.
245-
strip_prefix = "libevent-06a11929511bebaaf40c52aaf91de397b1782ba2",
246-
# 2020-05-08
247-
urls = ["https://github.com/libevent/libevent/archive/06a11929511bebaaf40c52aaf91de397b1782ba2.tar.gz"],
247+
strip_prefix = "libevent-62c152d9a7cd264b993dad730c4163c6ede2e0a3",
248+
# 2020-07-31
249+
urls = ["https://github.com/libevent/libevent/archive/62c152d9a7cd264b993dad730c4163c6ede2e0a3.tar.gz"],
248250
use_category = ["dataplane"],
249251
cpe = "cpe:2.3:a:libevent_project:libevent:*",
250252
),

source/common/event/libevent_scheduler.cc

+11
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,18 @@ void recordTimeval(Stats::Histogram& histogram, const timeval& tv) {
1616
} // namespace
1717

1818
LibeventScheduler::LibeventScheduler() {
19+
#ifdef WIN32
20+
event_config* event_config = event_config_new();
21+
RELEASE_ASSERT(event_config != nullptr,
22+
"Failed to initialize libevent event_base: event_config_new");
23+
// Request wepoll backend by avoiding win32 backend.
24+
int error = event_config_avoid_method(event_config, "win32");
25+
RELEASE_ASSERT(error == 0, "Failed to initialize libevent event_base: event_config_avoid_method");
26+
event_base* event_base = event_base_new_with_config(event_config);
27+
event_config_free(event_config);
28+
#else
1929
event_base* event_base = event_base_new();
30+
#endif
2031
RELEASE_ASSERT(event_base != nullptr, "Failed to initialize libevent event_base");
2132
libevent_ = Libevent::BasePtr(event_base);
2233

tools/spelling/spelling_dictionary.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,7 @@ vptr
11721172
wakeup
11731173
wakeups
11741174
websocket
1175+
wepoll
11751176
whitespace
11761177
whitespaces
11771178
wildcard

0 commit comments

Comments
 (0)