Re: Async branch documentation and review
Daniele Varrazzo <[email protected]> Sun, 11 Apr 2010 02:11:29 +0100
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Apr 8, 2010 at 1:33 PM, Daniele Varrazzo <[email protected]> wrote: > Hello, > > I've written documentation for the new Psycopg async support. Together > with other patches it is available in the "fix22" branch of my git > repos: > > https://www.develer.com/gitweb/pub?p=users/piro/psycopg2.git;a=shortlog;h=refs/heads/fix22 Hello Jan, sorry to bother you again :) but I've found another problem. I've committed a test for it in the above branch (595dc7ef). In the test I write bigger and bigger queries expecting eventually to trigger the condition "would block" on write (it happens randomly with queries between 1 and 20 MB). I wrote the test for the green branch to test the path in which PQflush returns 1. With an async query, the test doesn't pass (it gets blocked somewhere, strace says in a select() for read, maybe instead of one for write). I tried to understand where it happens but unfortunately now I'm too tired to understand anything now :( I only know that the test passes in the green branch, so if you are stuck you may take a look at the poll() implementation there to see what we do differently. Reading the code, I also see (pqpath.c, line 741) that you (or maybe fog before you) check PQpath to be only 0 or !=0: you should probably also check between 1 (retry) or -1 (hard error). It shouldn't be related to this bug anyway. Hope to be more helpful tomorrow. -- Daniele