envoyproxy / envoyproxy/envoy

hcm: improve onMatchCallback interface

Open
#15,956 2 comments 0 reactions 1 assignee Claimed by @snowp View on GitHub
area/matching enhancement help wanted
Dominant language
C++
Stars
28.9k
Forks
5.6k
Avg merge
1d 20h
Merged PRs (30d)
437

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.