forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Fatal Action extension point. (envoyproxy#13676)
Signed-off-by: Kevin Baichoo <[email protected]>
- Loading branch information
Showing
30 changed files
with
823 additions
and
20 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 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
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 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.