Skip to content

Commit

Permalink
Revert "debug: Assert policy destruction happens in the main thread"
Browse files Browse the repository at this point in the history
This reverts commit 17c48a7.
  • Loading branch information
sayboras committed Dec 2, 2024
1 parent c7b1578 commit 1617c00
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
11 changes: 0 additions & 11 deletions cilium/network_policy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -606,17 +606,6 @@ class PortNetworkPolicyRules : public Logger::Loggable<Logger::Id::config> {
}
}

~PortNetworkPolicyRules() {
if (!Thread::MainThread::isMainOrTestThread()) {
ENVOY_LOG_TO_LOGGER(Envoy::Logger::Registry::getLog(Envoy::Logger::Id::envoy_bug), error,
"envoy bug failure: !Thread::MainThread::isMainOrTestThread()");
Envoy::Assert::EnvoyBugStackTrace st;
st.capture();
st.logStackTrace();
::abort();
}
}

bool allowed(uint32_t remote_id, Envoy::Http::RequestHeaderMap& headers,
Cilium::AccessLog::Entry& log_entry, bool& denied) const {
// Empty set matches any payload from anyone
Expand Down
2 changes: 1 addition & 1 deletion cilium/network_policy.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class IPAddressPair {

class PolicyInstance {
public:
virtual ~PolicyInstance() { ASSERT_IS_MAIN_OR_TEST_THREAD(); };
virtual ~PolicyInstance() = default;

virtual bool allowed(bool ingress, uint32_t remote_id, uint16_t port,
Envoy::Http::RequestHeaderMap& headers,
Expand Down
5 changes: 1 addition & 4 deletions cilium/secret_watcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ SecretWatcher::SecretWatcher(const NetworkPolicyMap& parent, const std::string&
secret_provider_(secretProvider(parent.transportFactoryContext(), sds_name)),
update_secret_(readAndWatchSecret()) {}

SecretWatcher::~SecretWatcher() {
ASSERT_IS_MAIN_OR_TEST_THREAD();
delete load();
}
SecretWatcher::~SecretWatcher() { delete load(); }

Envoy::Common::CallbackHandlePtr SecretWatcher::readAndWatchSecret() {
store();
Expand Down

0 comments on commit 1617c00

Please sign in to comment.