Conversation
a27a5e3 to
1ffbacc
Compare
liran-funaro
left a comment
There was a problem hiding this comment.
The iterator does not have to hold the context in this case.
Instead, it.Next() should accept a context parameter, which is propagated downwards on a per call basis.
I suggest a re-work on the basis on the above claim.
I know. I went with the current design based on the following:
I don't mind adding ctx to the Next(). |
|
@cendhu Will introducing context to |
I expected so but It does not seem to be true given I making the changes. In fact, lesser number of changes. |
5a40e3e to
7e7cb92
Compare
Add context.Context to the block iterator so that waitForBlock respects context cancellation. This fixes goroutine leaks in callers like deliver.go where cursor.Next() blocks indefinitely even after the gRPC stream's context is cancelled. Signed-off-by: Senthilnathan <cendhu@gmail.com>
Type of change
Description
Add context.Context to the block iterator so that waitForBlock respects context cancellation. This fixes goroutine leaks in callers like deliver.go where cursor.Next() blocks indefinitely even after the gRPC stream's context is cancelled.