Bad file descriptor - rb_wait_for_single_fd()

Issue #282 resolved
Lars Kanis
created an issue

Mailed by Sam Saffron:

We upgraded to PG 1.1 this week and for the first time I am seeing error in async_exec with

    `ERRNO::EBADF`  (Bad file descriptor - rb_wait_for_single_fd())

Is there some change in async_exec that could be triggering this? We never saw this on 1.0. The frequency of the errors is very small, but there may be some sort of new concurrency issue.

Comments (7)

  1. Michael Granger repo owner

    Revert "Move PQsocket() to connection init for better performance"

    Storing a copy of the socket file descriptor has the risk of getting out of sync with the socket stored in PGconn. This could happen while conn.reset().

    Instead of fixing this, I propose to revert this commit. The performance benefit is not mesurable and it is in a code section where the client is waiting for the server anyways.

    Fixes #282 (hopefully)

    → <<cset b49f54dc755b>>

  2. Log in to comment