pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
libpq bug handling signals
2+ messages / 1 participants
[nested] [flat]

* libpq bug handling signals
@ 2002-08-17 04:39 Warren W. Gay VE3WWG <ve3wwg@cogeco.ca>
  2002-08-17 16:20 ` Re: libpq bug handling signals Warren W. Gay VE3WWG <ve3wwg@cogeco.ca>
  0 siblings, 1 reply; 2+ messages in thread

From: Warren W. Gay VE3WWG @ 2002-08-17 04:39 UTC (permalink / raw)
  To: pgsql-interfaces

I am experiencing problems with lo_write() (mostly), WRT to
life after a signal has been handled.

Socket I/O (read(2) for example) will return -1 and have errno = EINTR
if it was blocked reading, and a signal was handled successfully while
it was blocked. It appears that lo_write() should do something similar,
but doesn't in practice ...

If I clear errno=0 and then perform lo_write()s during which
time a signal is received and handled, lo_write() will return -1
indicating an error. However, upon checking the
errno vallue, it indicates that no error has occurred (errno=0).

However, if I set errno=EINTR prior to calling lo_write() each
time, the same -1 is returned (after a signal) but now the
errno = EINTR (as I had originally expected it should have been).

It appears that EINTR processing is not correct or is incomplete in
the libpq code. I have experienced similar weirdness in the
operation of lo_lseek().

Do I need to subsequently submit this as a bug somewhere?

Thanks, Warren.
-- 

Warren W. Gay VE3WWG
http://home.cogeco.ca/~ve3wwg





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: libpq bug handling signals
  2002-08-17 04:39 libpq bug handling signals Warren W. Gay VE3WWG <ve3wwg@cogeco.ca>
@ 2002-08-17 16:20 ` Warren W. Gay VE3WWG <ve3wwg@cogeco.ca>
  0 siblings, 0 replies; 2+ messages in thread

From: Warren W. Gay VE3WWG @ 2002-08-17 16:20 UTC (permalink / raw)
  To: pgsql-interfaces

Ignore this post. The problems were all mine. I checked the libpq
code it seems that it has done a good job at insulating the caller from
the vulgarities of EINTR and the like.

However, I would suggest that "errno be ignored" should be documented
in the libpq documentation, and that some note about EINTR handling
be added to make things clearer to the programmer using libpq.

Thanks, Warren.

Warren W. Gay VE3WWG wrote:

> I am experiencing problems with lo_write() (mostly), WRT to
> life after a signal has been handled.
>
> Socket I/O (read(2) for example) will return -1 and have errno = EINTR
> if it was blocked reading, and a signal was handled successfully while
> it was blocked. It appears that lo_write() should do something similar,
> but doesn't in practice ...
>
> If I clear errno=0 and then perform lo_write()s during which
> time a signal is received and handled, lo_write() will return -1
> indicating an error. However, upon checking the
> errno vallue, it indicates that no error has occurred (errno=0).
>
> However, if I set errno=EINTR prior to calling lo_write() each
> time, the same -1 is returned (after a signal) but now the
> errno = EINTR (as I had originally expected it should have been).
>
> It appears that EINTR processing is not correct or is incomplete in
> the libpq code. I have experienced similar weirdness in the
> operation of lo_lseek().
>
> Do I need to subsequently submit this as a bug somewhere?
>
> Thanks, Warren.


-- 
Warren W. Gay VE3WWG
http://home.cogeco.ca/~ve3wwg






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2002-08-17 16:20 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-08-17 04:39 libpq bug handling signals Warren W. Gay VE3WWG <ve3wwg@cogeco.ca>
2002-08-17 16:20 ` Warren W. Gay VE3WWG <ve3wwg@cogeco.ca>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox