You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/internal/GeneralArchitectureGuide.md
+10-4Lines changed: 10 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,14 +103,20 @@ are coordinated.
103
103
> the `Transport*Action` class that handles it.
104
104
>
105
105
> A netty [EventLoop] thread handles the initial steps of a Rest*Action request lifecycle such as decoding, validation and routing.
106
-
> Upon entry into the "transport layer", [NodeClient] delegates the remaining processing to its [TaskManager] thread. The [TaskManager]
107
-
> thread eventually returns control to the original [EventLoop] thread to write the response back to the Netty channel.
106
+
> Upon entry into the "transport layer", [NodeClient] delegates the decision of execution to individual [TransportAction]. Each action
107
+
> determines whether to execute synchronously on invoking thread-an approach reserved for lightweight processing-or to dispatch execution to an appropriate
108
+
> thread pool, which is recommended practice for heavy workloads. Comprehensive mechanisms are available for propagating [ThreadContext] when tasks
109
+
> are dispatched to alternate thread pools.
108
110
>
109
111
> [TransportAction] can also be initiated through peer-to-peer communication between nodes. In such cases, the [InboundHandler]
110
112
> locates the appropriate [TransportAction] by consulting the [NamedRegistry], then invokes its handleExecution() method. When a [TransportAction]
111
113
> is registered, it can specify an executor to control how the action is run. One option is the DIRECT_EXECUTOR_SERVICE, which executes the
112
114
> action on the calling thread. However, this should be used with caution—it's only appropriate when the action is lightweight.
113
115
> Otherwise, it risks blocking the peer-to-peer I/O thread, potentially degrading responsiveness and causing the node to become unresponsive.
116
+
> If [TransportAction] elects a separate executor, [InboundHandler] performs message deserialization before delegating execution to the executor,
117
+
> refer to [TransportResponseHandler] method executor() for more details.
118
+
>
119
+
>
114
120
115
121
### Action registration
116
122
Elasticsearch contains many [TransportAction]s, configured statically in [ActionModule#setupActions]. [ActionPlugin]s can
0 commit comments