Skip to content

Set timeouts for COPY operations - #3151

Merged
vonzshik merged 5 commits into
npgsql:mainfrom
vonzshik:CopyTimeouts
Nov 10, 2020
Merged

vonzshik merged 5 commits into
npgsql:mainfrom
vonzshik:CopyTimeouts

Conversation

@vonzshik

@vonzshik vonzshik commented Sep 17, 2020 •

Copy link
Copy Markdown
Contributor

Closes #1328

@vonzshik

vonzshik commented Oct 27, 2020 •

Copy link
Copy Markdown
Contributor Author

Per commentary, COPY export should attempt PG cancellation on a timeout for CopyData. Was done as a part of #3276.

@roji

roji commented Oct 28, 2020

Copy link
Copy Markdown
Member

@vonzshik what do you want to do with this? Is there anything relevant here after #3276?

@vonzshik

Copy link
Copy Markdown
Contributor Author

@vonzshik what do you want to do with this? Is there anything relevant here after #3276?

Why, an abitilty to set a timeout for the COPY operations! No more you have to send an empty query, to set a timeout.

@roji

roji commented Oct 28, 2020

Copy link
Copy Markdown
Member

Ah of course :)

OK, will let you rebase/clean up :)

@vonzshik

Copy link
Copy Markdown
Contributor Author

@roji okay, it's ready now. Although, maybe we should go over other COPY operations as well (handle exceptions).

@roji roji left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but let's consider TimeSpan instead of int for new properties.

We should ideally have a dedicated test for the timeouts, but that requires evolving the PG mock a bit. We can postpone.

Comment thread src/Npgsql/NpgsqlBinaryExporter.cs Resolved
Comment thread src/Npgsql/NpgsqlRawCopyStream.cs Resolved
Comment thread test/Npgsql.Tests/CopyTests.cs Resolved
@vonzshik
vonzshik merged commit 9fda64a into npgsql:main Nov 10, 2020
@vonzshik
vonzshik deleted the CopyTimeouts branch November 10, 2020 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Timeout and cancellation for COPY operations

2 participants