Skip to content

Commit

Permalink
examples: fixed fault-injection delay demo (envoyproxy#11715)
Browse files Browse the repository at this point in the history
fault injection example did not work for delay option. After gdb debugging it was discovered that fault injection config requires delay part to be present. Without delay part Envoy assumes that Delay is disabled and does not scan RTDS for delay config updates.

Risk Level: Low:
Testing: Did manual testing as described in https://www.envoyproxy.io/docs/envoy/latest/start/sandboxes/fault_injection
Docs Changes: No
Release Notes: No
Fixes: envoyproxy#11095
Signed-off-by: Christoph Pakulski <christoph@tetrate.io>
Signed-off-by: chaoqinli <chaoqinli@google.com>
  • Loading branch information
cpakulski authored and chaoqinli committed Jun 25, 2020
1 parent 89fc19f commit 2c9a3b8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
3 changes: 3 additions & 0 deletions examples/fault-injection/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ services:
ports:
- 9211:9211
- 9901:9901
# Run Envoy as root to grant access to /dev/stdout
environment:
ENVOY_UID: 0
backend:
image: kennethreitz/httpbin@sha256:2c7abc4803080c22928265744410173b6fea3b898872c01c5fd0f0f9df4a59fb
networks:
Expand Down
5 changes: 5 additions & 0 deletions examples/fault-injection/envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ static_resources:
percentage:
numerator: 0
denominator: HUNDRED
delay:
fixed_delay: 3s
percentage:
numerator: 0
denominator: HUNDRED
- name: envoy.filters.http.router
typed_config: {}
clusters:
Expand Down
8 changes: 1 addition & 7 deletions source/common/common/callback_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,8 @@ template <typename... CallbackArgs> class CallbackManager {

CallbackManager& parent_;
Callback cb_;
<<<<<<< HEAD

=======
>>>>>>> 4dfa8d4f5... make cast dynamic

// the iterator of this callback holder inside callbacks_ list
// upon removal, use this iterator to delete callback holder in O(1)
typename std::list<CallbackHolder>::iterator it_;
Expand All @@ -69,10 +67,6 @@ template <typename... CallbackArgs> class CallbackManager {
[handle](const CallbackHolder& holder) -> bool {
return handle == &holder;
}) != callbacks_.end());
<<<<<<< HEAD

=======
>>>>>>> 4dfa8d4f5... make cast dynamic
auto it = dynamic_cast<CallbackHolder*>(handle)->it_;
callbacks_.erase(it);
}
Expand Down

0 comments on commit 2c9a3b8

Please sign in to comment.