shotover / shotover-proxy

L7 data-layer proxy
https://docs.shotover.io
Apache License 2.0
83 stars 16 forks source link

Transform interface close_client_connection #1717

Closed rukai closed 1 month ago

rukai commented 1 month ago

prereq for https://github.com/shotover/shotover-proxy/pull/1715

codspeed benchmarks show performance regressions if you click through to the report.

Alternatives

Maybe we want an Option<oneshot::Sender> field in RequestWrapper instead?

One important case to consider is the tee transform. It needs to dynamically handle swapping between two different chains as the source of truth. So when one chain is activated it should be the one to be capable of closing the client connection.

I think mock out the API of this approach and then compare against this PR.

If https://github.com/shotover/shotover-proxy/pull/1719 yields good performance I think we can create a

struct RequestMeta {
  local_addr: SocketAddr,
  close_connection: Option<oneshot::Sender>,
  flush: bool,
}

And then include it in RequestWrapper as a &RequestMeta

codspeed-hq[bot] commented 1 month ago

CodSpeed Performance Report

Merging #1717 will not alter performance

Comparing rukai:shotover_close_connection (2b27012) with main (5cedf0d)

Summary

✅ 39 untouched benchmarks

rukai commented 1 month ago

closed in favor of https://github.com/shotover/shotover-proxy/pull/1722