-
Notifications
You must be signed in to change notification settings - Fork 449
[v0.23.2] PR #4803: fix(engine): disable feedback #4804
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
base: release-v0.23.0
Are you sure you want to change the base?
[v0.23.2] PR #4803: fix(engine): disable feedback #4804
Conversation
commit: 77d211e (main), cherry-pick
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR temporarily disables the engine’s feedback mechanism to avoid a deadlock when sending events back into the pipeline.
- Removes the
findings
import. - Comments out the feedback conversion and send logic with a TODO explaining the deadlock.
Comments suppressed due to low confidence (2)
pkg/signatures/engine/engine.go:152
- There's a duplicated 'to' in this comment ("trying to to send"). Consider removing the extra 'to' for clarity.
// a new event to the feedbacking signature. This would cause a deadlock
pkg/signatures/engine/engine.go:150
- [nitpick] The term "feedbacking signature" is unclear; consider rephrasing to "feedback signature" or "signature receiving feedback" for clarity.
// when the engine was blocked on sending a new event to the feedbacking signature.
// TODO: the feedback is disabled for now, as it was causing a deadlock | ||
// when the engine was blocked on sending a new event to the feedbacking signature. | ||
// This is because the engine would eventually block on trying to to send | ||
// a new event to the feedbacking signature. This would cause a deadlock | ||
// there - propagating back to the engine and pipeline in general. | ||
// We should keep it here for reference until we find a better solution. | ||
// if !engine.config.Enabled { | ||
// return | ||
// // next section is relevant only for engine-in-pipeline and analyze | ||
// } | ||
// e, err := findings.FindingToEvent(res) | ||
// if err != nil { | ||
// logger.Errorw("Failed to convert finding to event, will not feedback", "err", err) | ||
// return | ||
// } | ||
// prot := e.ToProtocol() | ||
// engine.inputs.Tracee <- prot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the large commented-out feedback block (lines 155–165). If you need to disable feedback temporarily, consider using a feature flag or referencing an issue to reduce noise and improve readability.
// TODO: the feedback is disabled for now, as it was causing a deadlock | |
// when the engine was blocked on sending a new event to the feedbacking signature. | |
// This is because the engine would eventually block on trying to to send | |
// a new event to the feedbacking signature. This would cause a deadlock | |
// there - propagating back to the engine and pipeline in general. | |
// We should keep it here for reference until we find a better solution. | |
// if !engine.config.Enabled { | |
// return | |
// // next section is relevant only for engine-in-pipeline and analyze | |
// } | |
// e, err := findings.FindingToEvent(res) | |
// if err != nil { | |
// logger.Errorw("Failed to convert finding to event, will not feedback", "err", err) | |
// return | |
// } | |
// prot := e.ToProtocol() | |
// engine.inputs.Tracee <- prot | |
// TODO: The feedback mechanism was disabled due to a deadlock issue. Refer to issue tracker for details. |
Copilot uses AI. Check for mistakes.
// prot := e.ToProtocol() | ||
// engine.inputs.Tracee <- prot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid potential deadlocks when re-enabling feedback, consider making this send non-blocking (e.g., using a select with a default case or buffering the channel).
// prot := e.ToProtocol() | |
// engine.inputs.Tracee <- prot | |
prot := e.ToProtocol() | |
select { | |
case engine.inputs.Tracee <- prot: | |
// Successfully sent to the channel | |
default: | |
logger.Warnw("Failed to send event to Tracee input channel, dropping event") | |
} |
Copilot uses AI. Check for mistakes.
c59f4c4
to
5c806a5
Compare
1. Explain what the PR does
5fdc7f3 PR #4803: fix(engine):disable feedback
2. Explain how to test it
3. Other comments