Bläddra i källkod

_really_ clean up stale readers.

* No crash after 150K SPARQL queries.
Stefano Cossu 7 år sedan
förälder
incheckning
b37cebadc9
1 ändrade filer med 8 tillägg och 0 borttagningar
  1. 8 0
      lakesuperior/store/ldp_rs/lmdb_store.py

+ 8 - 0
lakesuperior/store/ldp_rs/lmdb_store.py

@@ -812,6 +812,14 @@ class LmdbStore(Store):
         self.idx_env = lmdb.open(path + '/index', subdir=False, create=create,
                 map_size=self.MAP_SIZE, max_dbs=6, readahead=False)
 
+        # Clear stale readers.
+        data_stale_readers = self.data_env.reader_check()
+        idx_stale_readers = self.idx_env.reader_check()
+        logger.debug(
+                'Cleared data stale readers: {}'.format(data_stale_readers))
+        logger.debug(
+                'Cleared index stale readers: {}'.format(idx_stale_readers))
+
         # Open and optionally create main databases.
         self.dbs = {
             # Main databases.