envoyproxy/envoy

hcm: improve onMatchCallback interface

Open

#15.956 aberto em 13 de abr. de 2021

Ver no GitHub
 (2 comments) (0 reactions) (1 assignee)C++ (5.373 forks)batch import
area/matchingenhancementhelp wanted

Métricas do repositório

Stars
 (27.997 stars)
Métricas de merge de PR
 (Mesclagem média 8d) (378 fundiu PRs em 30d)

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.

Guia do colaborador