Skip to content

Set timeouts for COPY operations#3151

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

Set timeouts for COPY operations#3151
vonzshik merged 5 commits into
npgsql:mainfrom
vonzshik:CopyTimeouts

Conversation

@vonzshik
Copy link
Copy Markdown
Contributor

@vonzshik vonzshik commented Sep 17, 2020

Closes #1328

@vonzshik
Copy link
Copy Markdown
Contributor Author

vonzshik commented Oct 27, 2020

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

@roji
Copy link
Copy Markdown
Member

roji commented Oct 28, 2020

@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
Copy link
Copy Markdown
Member

roji commented Oct 28, 2020

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).

Copy link
Copy Markdown
Member

@roji roji left a comment

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 Outdated
Comment thread src/Npgsql/NpgsqlRawCopyStream.cs Outdated
Comment thread test/Npgsql.Tests/CopyTests.cs Outdated
@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