envoyproxy/envoy

hcm: improve onMatchCallback interface

Open

#15,956 opened on 2021年4月13日

GitHub で見る
 (2 comments) (0 reactions) (1 assignee)C++ (5,373 forks)batch import
area/matchingenhancementhelp wanted

Repository metrics

Stars
 (27,997 stars)
PR merge metrics
 (平均マージ 8d) (30d で 378 merged PRs)

説明

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.

コントリビューターガイド