Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop lock during getCopyData? #266

Open
ryantrinkle opened this issue Aug 1, 2018 · 2 comments
Open

Drop lock during getCopyData? #266

ryantrinkle opened this issue Aug 1, 2018 · 2 comments

Comments

@ryantrinkle
Copy link

ryantrinkle commented Aug 1, 2018

Would it be reasonable to drop the connection lock here?

I'm working on some code that needs to interleave (blocking) getCopyData and putCopyData. It seems to work for me when I manually break through the lock for putCopyData and flush, but I'm not sure whether that's actually OK.

@lpsmith
Copy link
Owner

lpsmith commented Aug 13, 2018

Maybe? It's been a long time since I've worked or thought about this bit of code. Though we would need to adopt some of the techniques in the Notification module in order to avoid some race conditions.

I'm not yet familiar with such use cases. Do you have a pointer to some documentation I could look at?

@ryantrinkle
Copy link
Author

I guess an alternative would be to explicitly support PGRES_COPY_BOTH mode. My specific use case is a replication connection, which requires the client to periodically send heartbeats to the server while continuing to (blockingly) wait on downstream content.

The documentation I'm following is here.

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

No branches or pull requests

2 participants