rollbar-go icon indicating copy to clipboard operation
rollbar-go copied to clipboard

client/transport.Close() does not support context

Open swojtasiak opened this issue 4 years ago • 4 comments

The close operation for client (and transport as well) should take context argument to make it possible to interrupt the method if it takes to long to send/close everything.

swojtasiak avatar Feb 19 '21 09:02 swojtasiak

The API is the standard library's Closer interface. Are you hoping for a separate interface entirely?

ijsnow avatar Mar 10 '22 18:03 ijsnow

Just a dedicated method like Close(ctx context.Context) would do the job. The problem is that your Close operation is a blocking one and can block graceful shutdown for undefined amount of time. In order to handle that case I have to run it in a separate goroutine leaving it behind when it takes to long to finish.

swojtasiak avatar Apr 13 '22 16:04 swojtasiak

@swojtasiak , can you check this PR https://github.com/rollbar/rollbar-go/pull/99 and let me know if this is what you want? Also I can add some public context setters. thx!

pawelsz-rb avatar Jun 29 '22 07:06 pawelsz-rb

@swojtasiak Does that PR meet the expectations you had in mind?

nieblara avatar Jul 15 '22 18:07 nieblara