[py-lmdb] Re: Potential bug in reporting num_readers from env.info()

  • From: David Wilson <dw@xxxxxxxx>
  • To: py-lmdb@xxxxxxxxxxxxx
  • Date: Mon, 6 Apr 2015 20:20:39 +0000

On Mon, Apr 06, 2015 at 03:55:44PM -0400, Offer Sharabi wrote:

> while working with lmdb we have noticed a potential bug in the num_readers as
> reported by the env.info() call. 

> This happens after some stale readers are removed. Say that 'env' is
> an Environment instance - the number of readers under the
> 'num_readers' key in the env.info() dictionary does not change, even
> when env.reader_check() returns a positive number. In contrast , the
> call to env.readers() only return the active readers as expected. 

Hi Offer,

Thanks for reporting this, looks like a documentation bug in the
binding. The 'numreaders' value returned by info() indicates the maximum
number of readers that have ever been active since the lock file was
created, it appears to be used to limit scanning of the reader table
during begin() to the last possibly used reader slot, whereas the table
produced by readers() only includes slots which were active at the time
of the mdb_reader_list() call, regardless of their position in the slot
table.

I'll confirm with upstream and update the docs shortly.


David

Other related posts: