Document the new timeout and cancellation behavior
- Soft (server-side) vs. hard (client-side) cancellation
- Cancellation timeout (in the connection string params page as well)
- Timeouts are per-operation, the cancellation token isn't stored internally.
- This means you must call Read/NextResult with the token to actually trigger the cancellation (see https://github.com/npgsql/npgsql/issues/4542)
- But just one Read/NextResult might not work, since if it has the data buffered, it ignores the token entirely.
- So the guidance should always be to consume the reader until the end.
- And are not aggregated (https://github.com/npgsql/npgsql/issues/1041)
- Nothing (yet) supported in multiplexing
- Describe statement_timeout and where it's problematic, and also how to configure it on the connection string (https://github.com/npgsql/efcore.pg/issues/2486#issuecomment-1231923351)
@roji we've ran into the the same misunderstanding as in https://github.com/npgsql/npgsql/issues/4542#issuecomment-1173920910 of whether a "cancelled" NpgSqlReader ignores the remaining data in the pipe when disposed or reads to the end.
What stops you from updating the documentation?
What stops you from updating the documentation?
Nothing, except time and priority constraints.
Understand.
Just as a suggestion: when this happens, please expand on NpgsqlDataReader.Close and NpgsqlDataReader.CloseAsync by posting a remark similar to SqlDataReader.Close:
...This may be a long operation depending on the amount of data to be consumed...
and
...the time to close may be shortened by calling the Cancel method of the associated SqlCommand object before the Close method is called...