Handle context expired/canceled in Query/Exec/Context
Passing an already canceled/expired context to QueryContext/ExecContext would return empty results without error because interruptOnDone would immediately set the "done" flag to one so the calling function (query or exec) would not enter the for loop doing the meaningful work. Similarly, if the context is expired/canceled at the "wrong time", the same behavior could happen. This patch first check the context is still valid when entering the function (before launching interruptOnDone), then if the funxtion is about to return no values and no error, it checks if the "done" flag is set and return the context error if it makes sense.
Loading
Please register or sign in to comment