Skip to content
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

hcm: improve onMatchCallback interface #15956

Open
snowp opened this issue Apr 13, 2021 · 2 comments
Open

hcm: improve onMatchCallback interface #15956

snowp opened this issue Apr 13, 2021 · 2 comments
Assignees
Labels
area/matching enhancement Feature requests. Not bugs or questions. help wanted Needs help!

Comments

@snowp
Copy link
Contributor

snowp commented Apr 13, 2021

The current onMatchCallback function is fairly basic and has no return value, which means that it cannot be used to influence the filter manager. For example, if something goes wrong during the match callback there is no way to safely issue a local reply as the filter manager will pass the data to the next FM callback, which then triggers all kinds of asserts as a local reply has already been issued.

Here's an initial suggestion to get this started:

enum class MatchCallbackStatus {
  // Continue filter chain iteration as normal.
  Continue,
  //  Stop the filter chain iteration and attempt to issue a local reply indicating the the stream failed.
  StopAndFailStream,
}

@mattklein123 @alyssawilk

Participating in pausing filter iteration ( + awaiting resumption via continue[De|En]coding) is tricky since the
matcher is shared between the decoding and encoding side, so leaving that out for now.

@snowp snowp added enhancement Feature requests. Not bugs or questions. area/matching labels Apr 13, 2021
@snowp snowp self-assigned this Apr 13, 2021
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label May 13, 2021
@snowp snowp added help wanted Needs help! and removed stale stalebot believes this issue/PR has not been touched recently labels May 13, 2021
@goncaloacbsilva
Copy link

goncaloacbsilva commented May 28, 2023

@snowp @mattklein123 @alyssawilk Hi everyone! I'm a Computer Science student from Instituto Superior Técnico (Portugal) and I'm taking a course where we have to contribute to open-source projects (already contributed in this repository to close #20003).
Can I open a PR for this issue?
I did a simple implementation based on the enum of the suggestion above and modified match_delegate to issue a local reply and stop the filter chain iteration when something goes wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/matching enhancement Feature requests. Not bugs or questions. help wanted Needs help!
Projects
None yet
Development

No branches or pull requests

2 participants