8000 [v0.23.2] PR #4803: fix(engine): disable feedback by NDStrahilevitz · Pull Request #4804 · aquasecurity/tracee · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[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

Draft
wants to merge 1 commit into
base: release-v0.23.0
Choose a base branch
from

Conversation

NDStrahilevitz
Copy link
Collaborator
@NDStrahilevitz NDStrahilevitz commented Jun 23, 2025

1. Explain what the PR does

5fdc7f3 PR #4803: fix(engine):disable feedback

fix(engine):disable feedback (#4803)

commit: 77d211e79996f (main), cherry-pick

2. Explain how to test it

3. Other comments

commit: 77d211e (main), cherry-pick
@Copilot Copilot AI review requested due to automatic review settings June 23, 2025 14:54
Copy link
@Copilot Copilot AI left a 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.

Comment on lines +149 to +165
// 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
Copy link
Preview
Copilot AI Jun 23, 2025

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.

Suggested change
// 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.

Comment on lines +164 to +165
// prot := e.ToProtocol()
// engine.inputs.Tracee <- prot
Copy link
Preview
Copilot AI Jun 23, 2025

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).

Suggested change
// 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.

@NDStrahilevitz NDStrahilevitz force-pushed the backport_23_no_feedback branch from c59f4c4 to 5c806a5 Compare June 23, 2025 14:59
@NDStrahilevitz NDStrahilevitz marked this pull request as draft June 23, 2025 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0