-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
engine: return new handles from
EngineHandle::initEngine
(#2129)
Until now, `EngineHandle` has always had a single value of `1`. In other words, the Envoy engine has always been a singleton with no way to run multiple independent engines. In order to support multiple concurrent engines (envoyproxy/envoy-mobile#332), we first need to make `EngineHandle::initEngine` create a new engine and rather than have functions that use the engine do a singleton lookup, we can use the `envoy_engine_t` as an opaque handle type to get back the `Envoy::Engine` instance. Several places were using a hardcoded value of `1`, so we need to plumb through the engine handles. With this change although you can now create multiple engine instances, it is not safe to do so because there is still some static state that will need to be untangled. Also note that like the singleton we have had until now, new engine instances that are created will leak, as there is no way to fully release the engine through the public API. This is intentional in order to reduce the risk associated with this change. Mike and I made these changes while pairing. The bulk of the ideas here are really from him. Risk Level: High. Testing: Existing tests & Lyft apps validation. Docs Changes: None. Release Notes: Added. Co-authored-by: Mike Schore <mike.schore@gmail.com> Co-authored-by: Alyssa Wilk <alyssar@chromium.org> Signed-off-by: JP Simard <jp@jpsim.com>
- Loading branch information
1 parent
58ac295
commit 518a8a5
Showing
14 changed files
with
70 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.