Skip to content

Timeout and cancellation for COPY operations #1328

@roji

Description

@roji

Socket timeouts can be set on NpgsqlCommand via the CommandTimeout property. However, COPY operations don't provide any API to set the timeout.

The current workaround is to execute some command before the COPY operation and set the socket timeout there.

At least for raw binary, where we expose a standard stream, it may make sense to expose timeout control via ReadTimeout and WriteTimeout (see also CanTimeout), though we need to understand whether these should work for async as well, and how things interact with async cancellation tokens.

Don't forget to populate the cancellation token in the OperationCanceledException and assert (#3252)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions