Skip to content
Commit 61828ad2 authored by Romain LE DISEZ's avatar Romain LE DISEZ
Browse files

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.
parent 075768b4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment