f5 / otel-arrow-adapter

Adapter used to convert OTEL batches to/from OTEL Arrow batches in both directions.
Apache License 2.0
39 stars 6 forks source link

replace exporter timeout with receiver timeout #211

Closed moh-osman3 closed 1 year ago

moh-osman3 commented 1 year ago

This PR is a followup to https://github.com/f5/otel-arrow-adapter/pull/207

Instead of the timeout happening in the client using max_stream_lifetime the timeout is moved to the server.

1.) The timeout in the server is max_connection_age - 2s, because sufficiently small grace period could cause gRPC to interrupt the connection before the server is able to send a signal to the client to close the stream. So I am subtracting a couple seconds to give the server extra time to send the shutdown signal to the client, otherwise shutdown may be ungraceful.

2.) The client could potentially get two signals from the server, an error and end_of_lifetime signal. This might take a couple of iterations for client.stream.write to process both signals, but both should eventually be processed. This can be seen in the added unit tests where an extra call to SendAndWait is needed to see the error for stream restart.