-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Added Fatal Action extension point. #13676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
1570d2c
Added Fatal Action extension point.
KBaichoo 2ac60e6
Various changes: cleaning up interfaces, among others.
KBaichoo 32fb212
Cleaned up tests, and interfaces.
KBaichoo 341d969
added release notes.
KBaichoo 91030d9
Fixed failing tests.
KBaichoo 502e609
Added Fatal Actions to extending envoy documentation.
KBaichoo ee15888
Clang-tidy and test fixes.
KBaichoo 564668d
Fixed asan issue.
KBaichoo c4e105c
Modified death message as it relies on signal handlers that can get h…
KBaichoo 4170d6d
Changed the FatalAction functions to return a status to account for m…
KBaichoo c5dfe7a
Fixed Asan hijacking signals for tests where the death test message m…
KBaichoo 5faddf0
Merge remote-tracking branch 'upstream/master' into fh-extension-pt
KBaichoo 9bc90ba
Minor nits.
KBaichoo a35f53a
Merge remote-tracking branch 'upstream/master' into fh-extension-pt
KBaichoo 4f96adf
Made test size larger to see if that helps with windows timeout.
KBaichoo d8a605d
Removed annotations to debug test.
KBaichoo b70ae54
Added comments about Fatal Action extension interface.
KBaichoo 565025e
Cleaned up api comment nits.
KBaichoo ac0f168
Added test guard.
KBaichoo f3e1911
Spelling fix.
KBaichoo bff6e4f
Merge remote-tracking branch 'upstream/master' into fh-extension-pt
KBaichoo b023b5c
Minor comments, updated docs.
KBaichoo bcaee64
Cleaned up code, updated relaxed memory order usages.
KBaichoo 0dce2af
Moved atomic ops to use sequential consistency since the module isn't…
KBaichoo 9fcfd5f
Removed redundant seq_cst since atomic ops have it as the default param.
KBaichoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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
20 changes: 19 additions & 1 deletion
20
generated_api_shadow/envoy/config/bootstrap/v3/bootstrap.proto
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
23 changes: 22 additions & 1 deletion
23
generated_api_shadow/envoy/config/bootstrap/v4alpha/bootstrap.proto
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| #pragma once | ||
|
|
||
| #include <memory> | ||
|
|
||
| #include "envoy/common/pure.h" | ||
| #include "envoy/config/bootstrap/v3/bootstrap.pb.h" | ||
| #include "envoy/config/typed_config.h" | ||
| #include "envoy/event/dispatcher.h" | ||
| #include "envoy/protobuf/message_validator.h" | ||
| #include "envoy/server/instance.h" | ||
|
|
||
| namespace Envoy { | ||
| namespace Server { | ||
| namespace Configuration { | ||
|
|
||
| class FatalAction { | ||
| public: | ||
| virtual ~FatalAction() = default; | ||
| /** | ||
| * Callback function to run when we are crashing. | ||
| * @param current_object the object we were working on when we started | ||
| * crashing. | ||
| */ | ||
| virtual void run(const ScopeTrackedObject* current_object) PURE; | ||
|
|
||
| /** | ||
| * @return whether the action is async-signal-safe. | ||
| * See man 7 signal-safety for the definition of async-signal-safe. | ||
| */ | ||
| virtual bool isAsyncSignalSafe() const PURE; | ||
| }; | ||
|
|
||
| using FatalActionPtr = std::unique_ptr<FatalAction>; | ||
|
|
||
| /** | ||
| * Implemented by each custom FatalAction and registered via Registry::registerFactory() | ||
| * or the convenience class RegisterFactory. | ||
| */ | ||
| class FatalActionFactory : public Config::TypedFactory { | ||
| public: | ||
| ~FatalActionFactory() override = default; | ||
|
|
||
| /** | ||
| * Creates a particular FatalAction implementation. | ||
| * | ||
| * @param config supplies the configuration for the action. | ||
| * @param context supplies the GuardDog Action's context. | ||
| * @return FatalActionsPtr the FatalActions object. | ||
| */ | ||
| virtual FatalActionPtr | ||
| createFatalActionFromProto(const envoy::config::bootstrap::v3::FatalAction& config, | ||
| Instance* server) PURE; | ||
|
|
||
| std::string category() const override { return "envoy.fatal_action"; } | ||
| }; | ||
|
|
||
| } // namespace Configuration | ||
| } // namespace Server | ||
| } // namespace Envoy | ||
This file contains hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.