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

  • From: Offer Sharabi <offer@xxxxxxxxxxxx>
  • To: py-lmdb@xxxxxxxxxxxxx
  • Date: Mon, 6 Apr 2015 15:55:44 -0400

Hi David,
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.

To replicate :
1. open a python shell, and create an 'active' reader by creating an
environment, and opening a transaction.
2. repeat step 1 in a new shell.
3. Call env.info() and verify that num_readers is 2 as expected.
4. Call env.readers() and see that indeed you get 2 readers.
5. Force kill one of the python processes. ( kill -9 <pid> )
6. Call env.reader_check() and see that it returns 1
7. Call env.info(). The num readers still shows 2 instead of 1.
8. Call env.readers() and see that there is only one reader as expected.


This is just something that we noticed and wanted to bring to your
attention,
we are just not using this value for monitoring at the moment.

Thanks in advance,
Offer

*MAGNE**+**I**C*

*Offer Sharabi *|* Software Developer*

magnetic.com <http://www.magnetic.com/>  | blog
<http://www.magnetic.com/magnetic-culture/>  |  t
<https://twitter.com/MagneticIs>witter <https://twitter.com/MagneticIs>  |
facebook <https://www.facebook.com/pages/Magnetic/297609126995926>  |
linkedin <http://www.linkedin.com/company/magnetic_2>  |  youtube
<http://www.youtube.com/user/MagneticRetargeting>

Other related posts: