Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[improve][proxy] Remove unnecessary executor callback; use assert (#1…
…9670) ### Motivation The `DirectProxyHandler` and the `ProxyConnection` are run in the same event loop to prevent context switching. As such, we do not need to schedule an event onto an event loop that is in fact the same event loop. Further, scheduling on that event loop could have resulted in uncaught failures because the method was run without any error handling. Additionally, we can use `assert` to verify that we are in the event loop. Netty makes extensive use of this paradigm, as described in this PR #19653. The primary benefit here is that we skip some unnecessary volatile reads when running the code in production. ### Modifications * Replace `checkState` with `assert` in `ProxyConnection` class * Remove unnecessary event execution in callback when starting up the `DirectProxyHandler`. ### Verifying this change This change is covered by the assertions that are added. ### Does this pull request potentially affect one of the following parts: This is a minor improvement that should not break anything. ### Documentation - [x] `doc-not-needed` ### Matching PR in forked repository PR in forked repository: michaeljmarshall#33
- Loading branch information