envoyproxy / envoyproxy/envoy

support exception-free build

Open
#27,412 7 comments 0 reactions 0 assignees View on GitHub
enhancement no stalebot
Dominant language
C++
Stars
28.9k
Forks
5.6k
Avg merge
1d 22h
Merged PRs (30d)
430

Description

We've slowly whittled down exceptions from the Envoy data plane but even with the work we've done on https://github.com/envoyproxy/envoy/issues/14320 there are still some exceptions in the data plane, and it's hard for new users of Envoy to know where to use exceptions and where to use other error handling.

I'd like to move towards Envoy being able to build without exceptions entirely, primarily for https://github.com/envoyproxy/envoy-mobile/issues/176 but also due to continued concerns in-house with performance and safety of exceptions.

I have a proof-of-concept "no exceptions" build of Envoy Mobile, which currently replaces "throw" with "throw or panic" in about 60 files (down from ~120, and envoy mobile panics on config parse fail in any case), and straight removal of catch macros. I'd like to
1) disallow new core code files from throwing exceptions (which we can add to iff necessary)
2) replace existing catch calls with CATCH_EXCEPTION_MAIN_THREAD{} which can compile out in no-exceptions build
3) slowly replace the throwEnvoyExceptionOrPanic call sites with statusOr returns boiling up to base server creation
4) as each plug-in gets a "throw free" creation mode, disallow new extensions of that type from throwing on creation

we'll probably have to keep the TRY/CATCH macros in Envoy code perpetually, but it'd be really fantastic to get at least core code building without it, and maybe some of the folks who are eager to do clean up work can work on moving older extensions to statusor mode.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.