envoyproxy/envoy

hcm: improve onMatchCallback interface

Open

#15,956 建立於 2021年4月13日

在 GitHub 查看
 (2 留言) (0 反應) (1 負責人)C++ (5,373 fork)batch import
area/matchingenhancementhelp wanted

倉庫指標

Star
 (27,997 star)
PR 合併指標
 (平均合併 8天) (30 天內合併 378 個 PR)

描述

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.

貢獻者指南