Skip to content

Commit

Permalink
IomgrEventEngine Redux (grpc#29693)
Browse files Browse the repository at this point in the history
* Revert "Revert "IomgrEventEngine (grpc#29616)" (grpc#29692)"

This reverts commit 246d13e.

* temporarily disable EE usage to coordinate landing

* spelling
  • Loading branch information
drfloob authored and lidizheng committed May 24, 2022
1 parent 4730c37 commit 4790992
Show file tree
Hide file tree
Showing 30 changed files with 786 additions and 32 deletions.
121 changes: 109 additions & 12 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ grpc_cc_library(
"channel_init",
"channel_stack_type",
"config",
"default_event_engine_factory_hdrs",
"gpr_base",
"grpc_authorization_base",
"grpc_base",
Expand All @@ -407,6 +408,7 @@ grpc_cc_library(
"grpc_security_base",
"grpc_trace",
"http_connect_handshaker",
"iomgr_timer",
"slice",
"tcp_connect_handshaker",
],
Expand Down Expand Up @@ -455,6 +457,7 @@ grpc_cc_library(
"channel_init",
"channel_stack_type",
"config",
"default_event_engine_factory_hdrs",
"gpr_base",
"grpc_authorization_base",
"grpc_base",
Expand All @@ -464,6 +467,7 @@ grpc_cc_library(
"grpc_security_base",
"grpc_trace",
"http_connect_handshaker",
"iomgr_timer",
"slice",
"tcp_connect_handshaker",
],
Expand Down Expand Up @@ -1514,6 +1518,7 @@ grpc_cc_library(
"grpc_base",
"grpc_codegen",
"grpc_trace",
"iomgr_timer",
"slice",
],
)
Expand Down Expand Up @@ -1885,6 +1890,41 @@ grpc_cc_library(
],
)

grpc_cc_library(
name = "iomgr_timer",
srcs = [
"src/core/lib/iomgr/time_averaged_stats.cc",
"src/core/lib/iomgr/timer.cc",
"src/core/lib/iomgr/timer_generic.cc",
"src/core/lib/iomgr/timer_heap.cc",
"src/core/lib/iomgr/timer_manager.cc",
],
hdrs = [
"src/core/lib/iomgr/timer.h",
"src/core/lib/iomgr/timer_generic.h",
"src/core/lib/iomgr/timer_heap.h",
"src/core/lib/iomgr/timer_manager.h",
"src/core/lib/iomgr/time_averaged_stats.h",
] + [
# TODO(hork): deduplicate
"src/core/lib/iomgr/iomgr.h",
],
external_deps = [
"absl/strings",
],
deps = [
"event_engine_base_hdrs",
"exec_ctx",
"gpr_base",
"gpr_platform",
"gpr_tls",
"grpc_trace",
"iomgr_port",
"time",
"useful",
],
)

grpc_cc_library(
name = "iomgr_fwd",
hdrs = [
Expand Down Expand Up @@ -1954,13 +1994,39 @@ grpc_cc_library(
srcs = [
"src/core/lib/event_engine/default_event_engine_factory.cc",
],
external_deps = ["absl/memory"],
deps = [
"default_event_engine_factory_hdrs",
"event_engine_base_hdrs",
"gpr_base",
"iomgr_event_engine",
"iomgr_port",
],
)

grpc_cc_library(
name = "iomgr_event_engine",
srcs = ["src/core/lib/event_engine/iomgr_engine.cc"],
hdrs = ["src/core/lib/event_engine/iomgr_engine.h"],
external_deps = [
# TODO(hork): uv, in a subsequent PR
"absl/cleanup",
"absl/container:flat_hash_set",
"absl/time",
"absl/strings",
],
deps = [
"default_event_engine_factory_hdrs",
"closure",
"error",
"event_engine_base_hdrs",
"event_engine_common",
"event_engine_trace",
"exec_ctx",
"gpr_base",
"gpr_platform",
"grpc_trace",
"iomgr_timer",
"match",
"time",
],
)

Expand All @@ -1971,8 +2037,15 @@ grpc_cc_library(
"src/core/lib/event_engine/slice.cc",
"src/core/lib/event_engine/slice_buffer.cc",
],
hdrs = [
"src/core/lib/event_engine/handle_containers.h",
],
external_deps = [
"absl/container:flat_hash_set",
],
deps = [
"event_engine_base_hdrs",
"event_engine_trace",
"gpr_base",
"gpr_platform",
"ref_counted",
Expand All @@ -1981,6 +2054,20 @@ grpc_cc_library(
],
)

grpc_cc_library(
name = "event_engine_trace",
srcs = [
"src/core/lib/event_engine/trace.cc",
],
hdrs = [
"src/core/lib/event_engine/trace.h",
],
deps = [
"gpr_platform",
"grpc_trace",
],
)

grpc_cc_library(
name = "event_engine_base",
srcs = [
Expand All @@ -1990,7 +2077,9 @@ grpc_cc_library(
"default_event_engine_factory",
"default_event_engine_factory_hdrs",
"event_engine_base_hdrs",
"event_engine_trace",
"gpr_base",
"grpc_trace",
],
)

Expand Down Expand Up @@ -2120,11 +2209,6 @@ grpc_cc_library(
"src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc",
"src/core/lib/iomgr/tcp_server_windows.cc",
"src/core/lib/iomgr/tcp_windows.cc",
"src/core/lib/iomgr/time_averaged_stats.cc",
"src/core/lib/iomgr/timer.cc",
"src/core/lib/iomgr/timer_generic.cc",
"src/core/lib/iomgr/timer_heap.cc",
"src/core/lib/iomgr/timer_manager.cc",
"src/core/lib/iomgr/unix_sockets_posix.cc",
"src/core/lib/iomgr/unix_sockets_posix_noop.cc",
"src/core/lib/iomgr/wakeup_fd_eventfd.cc",
Expand Down Expand Up @@ -2247,11 +2331,6 @@ grpc_cc_library(
"src/core/lib/iomgr/tcp_server.h",
"src/core/lib/iomgr/tcp_server_utils_posix.h",
"src/core/lib/iomgr/tcp_windows.h",
"src/core/lib/iomgr/time_averaged_stats.h",
"src/core/lib/iomgr/timer.h",
"src/core/lib/iomgr/timer_generic.h",
"src/core/lib/iomgr/timer_heap.h",
"src/core/lib/iomgr/timer_manager.h",
"src/core/lib/iomgr/unix_sockets_posix.h",
"src/core/lib/iomgr/wakeup_fd_pipe.h",
"src/core/lib/iomgr/wakeup_fd_posix.h",
Expand Down Expand Up @@ -2358,6 +2437,7 @@ grpc_cc_library(
"grpc_trace",
"handshaker_registry",
"iomgr_port",
"iomgr_timer",
"json",
"latch",
"memory_quota",
Expand Down Expand Up @@ -2733,6 +2813,7 @@ grpc_cc_library(
"http_connect_handshaker",
"httpcli",
"iomgr_fwd",
"iomgr_timer",
"json",
"json_util",
"orphanable",
Expand Down Expand Up @@ -2817,6 +2898,7 @@ grpc_cc_library(
"gpr_base",
"grpc_base",
"idle_filter_state",
"iomgr_timer",
"loop",
"promise",
"single_set_ptr",
Expand All @@ -2838,6 +2920,7 @@ grpc_cc_library(
"config",
"gpr_base",
"grpc_base",
"iomgr_timer",
"slice",
],
)
Expand Down Expand Up @@ -3044,6 +3127,7 @@ grpc_cc_library(
"grpc_sockaddr",
"grpc_trace",
"grpc_transport_chttp2_client_connector",
"iomgr_timer",
"json",
"orphanable",
"protobuf_duration_upb",
Expand Down Expand Up @@ -3093,6 +3177,7 @@ grpc_cc_library(
"grpc_security_base",
"grpc_service_config_impl",
"grpc_trace",
"iomgr_timer",
"json",
"json_util",
"orphanable",
Expand Down Expand Up @@ -3223,6 +3308,7 @@ grpc_cc_library(
"grpc_sockaddr",
"grpc_tls_credentials",
"grpc_transport_chttp2_client_connector",
"iomgr_timer",
"json",
"json_util",
"orphanable",
Expand Down Expand Up @@ -3466,6 +3552,7 @@ grpc_cc_library(
"grpc_codegen",
"grpc_resolver_xds_header",
"grpc_trace",
"iomgr_timer",
"json",
"orphanable",
"ref_counted",
Expand Down Expand Up @@ -3624,6 +3711,7 @@ grpc_cc_library(
"grpc_codegen",
"grpc_lb_address_filtering",
"grpc_trace",
"iomgr_timer",
"json",
"orphanable",
"ref_counted",
Expand Down Expand Up @@ -3654,6 +3742,7 @@ grpc_cc_library(
"grpc_codegen",
"grpc_lb_address_filtering",
"grpc_trace",
"iomgr_timer",
"json",
"orphanable",
"ref_counted",
Expand Down Expand Up @@ -3826,6 +3915,7 @@ grpc_cc_library(
"gpr_base",
"grpc_base",
"grpc_resolver",
"iomgr_timer",
"orphanable",
"ref_counted_ptr",
"uri_parser",
Expand Down Expand Up @@ -3871,6 +3961,7 @@ grpc_cc_library(
"grpc_resolver",
"grpc_resolver_dns_selection",
"grpc_trace",
"iomgr_timer",
"orphanable",
"polling_resolver",
"ref_counted_ptr",
Expand Down Expand Up @@ -3926,6 +4017,7 @@ grpc_cc_library(
"grpc_trace",
"iomgr_fwd",
"iomgr_port",
"iomgr_timer",
"json",
"orphanable",
"polling_resolver",
Expand Down Expand Up @@ -5057,6 +5149,7 @@ grpc_cc_library(
"hpack_encoder_table",
"httpcli",
"iomgr_fwd",
"iomgr_timer",
"memory_quota",
"orphanable",
"pid_controller",
Expand Down Expand Up @@ -5158,6 +5251,7 @@ grpc_cc_library(
"handshaker",
"handshaker_registry",
"iomgr_fwd",
"iomgr_timer",
"memory_quota",
"orphanable",
"ref_counted",
Expand Down Expand Up @@ -5287,6 +5381,7 @@ grpc_cc_library(
"grpc_service_config_impl",
"grpc_trace",
"grpc_transport_inproc",
"iomgr_timer",
"ref_counted",
"useful",
],
Expand Down Expand Up @@ -5321,6 +5416,7 @@ grpc_cc_library(
"grpc_trace",
"grpc_transport_inproc",
"grpc_unsecure",
"iomgr_timer",
"ref_counted",
"useful",
],
Expand Down Expand Up @@ -5495,6 +5591,7 @@ grpc_cc_library(
"grpc++",
"grpc++_codegen_base",
"grpc_base",
"iomgr_timer",
"protobuf_duration_upb",
"ref_counted",
"time",
Expand Down
Loading

0 comments on commit 4790992

Please sign in to comment.