Re: Cygwin PostgreSQL Regression Test Problems (Revisited)

Поиск
Список
Период
Сортировка
От Jason Tishler
Тема Re: Cygwin PostgreSQL Regression Test Problems (Revisited)
Дата
Msg-id 20010330172026.L209@dothill.com
обсуждение исходный текст
Ответ на Re: Cygwin PostgreSQL Regression Test Problems (Revisited)  (Jason Tishler <Jason.Tishler@dothill.com>)
Ответы RE: Cygwin PostgreSQL Regression Test Problems (Revisited)
Список pgsql-ports
Tom,

On Fri, Mar 30, 2001 at 09:25:47AM -0500, Jason Tishler wrote:
> Any feedback on my patch (reattached for convenience)?  I would hate to
> see 7.1 go out the door with this issue.

I believe that I have finally found the root cause to the psql hangs.
IMO, Cygwin is functioning properly and the issue lies in the libpq's
pqWait() use of select().

The MSDN states the following for select():

..
Summary:
    A socket will be identified in a particular set when select returns if:

..

exceptfds:
    If processing a connect call (nonblocking), connection attempt failed.
..

In libpq's pqWait(), we have the following:

    if (select(conn->sock + 1, &input_mask, &output_mask, (fd_set *) NULL,
        (struct timeval *) NULL) < 0)

After reading the above code, I hypothesized that select() was hanging
because the exceptfds was NULL.

Sure enough, if I apply the attached (nasty, hacky) patch, then the
regression test does *not* hang anymore -- even with nonblocking connects.
Although some tests will fail due to a connection refused condition --
which is not unreasonable since postmaster is very busy.

IMO, pqWait() should be enhanced to check the exceptfds too -- at least
for Cygwin.  If it is not too late in the release cycle to consider such
a change, then someone with much more intimate knowledge of libpq should
only use my patch as a starting point and then do the right thing.

If the above enhancement is deemed too risky, then I implore the
PostgreSQL team to accept my previous patch that just makes connects
blocking for Cygwin.  Note with this patch applied, I did see some
regression test failures due to a connection refused condition -- for
the same reasons as above.

Thanks,
Jason

--
Jason Tishler
Director, Software Engineering       Phone: +1 (732) 264-8770 x235
Dot Hill Systems Corp.               Fax:   +1 (732) 264-8798
82 Bethany Road, Suite 7             Email: Jason.Tishler@dothill.com
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com

Вложения

В списке pgsql-ports по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Compiling PostgreSQL 7.x on BeOS R5?
Следующее
От: "Hiroshi Inoue"
Дата:
Сообщение: RE: Cygwin PostgreSQL Regression Test Problems (Revisited)