Discussion:
Stdio.Buffer peculiar state?
Stephen R. van den Berg
2014-12-02 15:41:42 UTC
Permalink
I'm trying to hunt down certain long-term-running pgsql issues I'm still
seeing.
While weeding through the backtraces I find the following Stdio.Buffer
state:

Sql.pgsql_util.conxiin(0 bytes, read=[..-1] data=[0..-1] free=[0..8160] allocated)->range_error(1)

What does it take to get a right-hand endpoint of -1 for read and data there?
It seems like the connection is now stuck in a busy loop reading 0 bytes
all the time from the network.
The conxxion class inherits Stdio.Buffer but is only used for read buffering.
--
Stephen.
Per Hedbor () @ Pike (-) importmöte för mailinglistan
2014-12-02 15:55:01 UTC
Permalink
Post by Stephen R. van den Berg
What does it take to get a right-hand endpoint of -1 for read and data there?
It just indicates an empty range.

Basically, the buffer is 8k, byte 0..-1, inclusive (an empty range,
unlike 0..0, inclusive) is already read data, the data is the same
size (also 0 bytes long).

So, it's simply an empty buffer.
Post by Stephen R. van den Berg
It seems like the connection is now stuck in a busy loop reading 0 bytes
all the time from the network.
If you do read and the connection is closed or there is no data
available and it's in nonblocking mode you will indeed read 0 bytes.

However, unless the connection is closed it should not be a busy loop
(you can check fd->errno())

Loading...