Correct way to use withRequestTimeout directive with akka-grpc

I’m using akka-grpc 1.0.2 and trying to setup an endpoint timeout.

My route looks like this:

val handler = MyServiceHandler(...)
val rpcTimeout = ...
Route.asyncHandler {
  withRequestTimeout(rpcTimeout) { implicit rctx =>
    handler(rctx.request).map(RouteResult.Complete)
  }
}

The requests complete as expected, but I’m seeing this warning all over the logs:

2020-11-09 10:41:15.810 [myapp-akka.actor.default-dispatcher-5] WARN  akka.actor.ActorSystemImpl - withRequestTimeout was used in route however no request-timeout is set!

It looks like the withRequestTimeout method is printing this warning because it can’t find a Timeout-Access header. I’ve also tried injecting this header using mapRequest(_.withHeaders(new Timeout-Access(???))), but I’m not sure how to instantiate a proper Timeout-Access. The comments on the TimeoutAccess trait say “Not for user extension.” which makes it seem like this is probably the wrong way to mute that warning.

Looks like request timeout is not yet implemented for the HTTP/2 server (which is what gRPC uses). I’ve created https://github.com/akka/akka-http/issues/3626 to track adding support for that.