Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ try-import ./envoy/.bazelrc
# Common flags for all builds
build --define=google_grpc=disabled
build --define=hot_restart=disabled
build --define=signal_trace=disabled
build --define=tcmalloc=disabled
build --features=debug_prefix_map_pwd_is_dot
build --features=swift.cacheable_swiftmodules
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/android_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- name: 'Run Java library tests'
if: steps.check_context.outputs.run_tests == 'true'
run: |
bazelisk test --test_output=all --build_tests_only //test/java/...
bazelisk test --test_output=all --build_tests_only --define=signal_trace=disabled //test/java/...
kotlintestslinux:
# Only kotlin tests are executed since with linux:
# https://github.com/envoyproxy/envoy-mobile/issues/1418.
Expand Down
7 changes: 6 additions & 1 deletion library/common/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ envoy_cc_library(
"@envoy//source/common/common:random_generator_lib",
"@envoy//source/common/runtime:runtime_lib",
"@envoy//source/exe:main_common_lib",
],
] + select({
"@envoy//bazel:disable_signal_trace": [],
"//conditions:default": [
"@envoy//source/common/signal:sigaction_lib",
],
}),
)

envoy_cc_library(
Expand Down
12 changes: 12 additions & 0 deletions library/common/engine_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
#include "source/server/listener_hooks.h"
#include "source/server/options_impl.h"

#ifdef ENVOY_HANDLE_SIGNALS
#include "source/common/signal/signal_action.h"
#include "source/exe/terminate_handler.h"
#endif

namespace Envoy {

/**
Expand All @@ -27,6 +32,13 @@ class EngineCommon {
Server::Instance* server() { return base_.server(); }

private:
#ifdef ENVOY_HANDLE_SIGNALS
// TODO(junr03): build a derived Event::SignalAction that uses the Envoy Logger as the ostream.
// https://github.com/envoyproxy/envoy-mobile/issues/1497.
Envoy::SignalAction handle_sigs_;
Envoy::TerminateHandler log_on_terminate_;
#endif

Envoy::OptionsImpl options_;
Event::RealTimeSystem real_time_system_; // NO_CHECK_FORMAT(real_time)
DefaultListenerHooks default_listener_hooks_;
Expand Down
21 changes: 21 additions & 0 deletions library/common/event/provisional_dispatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,26 @@ void ProvisionalDispatcher::deferredDelete(DeferredDeletablePtr&& to_delete) {
event_dispatcher_->deferredDelete(std::move(to_delete));
}

void ProvisionalDispatcher::pushTrackedObject(const ScopeTrackedObject* object) {
RELEASE_ASSERT(
isThreadSafe(),
"ProvisionalDispatcher::pushTrackedObject must be called from a threadsafe context");
event_dispatcher_->pushTrackedObject(object);
}

void ProvisionalDispatcher::popTrackedObject(const ScopeTrackedObject* expected_object) {
RELEASE_ASSERT(
isThreadSafe(),
"ProvisionalDispatcher::popTrackedObject must be called from a threadsafe context");
event_dispatcher_->popTrackedObject(expected_object);
}

bool ProvisionalDispatcher::trackedObjectStackIsEmpty() const {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When does this get called?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on your check below, we might want to lock here, depending on the usage.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually never gets currently called. I could change usage to NOT_REACHED. But for now I changed to isThreadSafe assertion.

RELEASE_ASSERT(
isThreadSafe(),
"ProvisionalDispatcher::trackedObjectStackIsEmpty must be called from a threadsafe context");
return event_dispatcher_->trackedObjectStackIsEmpty();
}

} // namespace Event
} // namespace Envoy
7 changes: 6 additions & 1 deletion library/common/event/provisional_dispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ namespace Event {
* versions may support correct calling semantics after the Event::Dispatcher has been
* terminated/deleted or before it has been created.
*/
class ProvisionalDispatcher {
class ProvisionalDispatcher : public ScopeTracker {
public:
ProvisionalDispatcher() = default;
virtual ~ProvisionalDispatcher() = default;

// ScopeTracker
void pushTrackedObject(const ScopeTrackedObject* object) override;
void popTrackedObject(const ScopeTrackedObject* expected_object) override;
bool trackedObjectStackIsEmpty() const override;

/**
* Drains all queued callbacks to the real dispatcher. Must be called after the underlying
* dispatcher is running. Further posts will be transparently passed through.
Expand Down
2 changes: 2 additions & 0 deletions library/common/extensions/filters/http/platform_bridge/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ envoy_cc_extension(
"//library/common/http:header_utility_lib",
"//library/common/http:internal_headers_lib",
"//library/common/types:c_types_lib",
"@envoy//envoy/common:scope_tracker_interface",
"@envoy//envoy/http:filter_interface",
"@envoy//source/common/common:minimal_logger_lib",
"@envoy//source/common/common:scope_tracker",
"@envoy//source/extensions/filters/http/common:pass_through_filter_lib",
],
)
Expand Down
Loading