Commit 50320274 authored by Hanno Schlichting's avatar Hanno Schlichting

Backport c122072 from trunk - close databases on shutdown to write out .index file

parent 52ad803b
...@@ -8,12 +8,15 @@ http://docs.zope.org/zope2/releases/. ...@@ -8,12 +8,15 @@ http://docs.zope.org/zope2/releases/.
2.13.19 (unreleased) 2.13.19 (unreleased)
-------------------- --------------------
- LP #930812: Scrub headers a bit more.
- Updated distributions: - Updated distributions:
- tempstorage = 2.12.2 - tempstorage = 2.12.2
- Explicitly close all databases on shutdown, which ensures `Data.fs.index`
gets written to the file system.
- LP #930812: Scrub headers a bit more.
- Fix lock and pid file handling on Windows. On other platforms - Fix lock and pid file handling on Windows. On other platforms
starting Zope tolerated existing or locked files, this now also starting Zope tolerated existing or locked files, this now also
works on Windows. works on Windows.
......
...@@ -76,7 +76,7 @@ def startup(): ...@@ -76,7 +76,7 @@ def startup():
m=imp.find_module('custom_zodb',[configuration.testinghome]) m=imp.find_module('custom_zodb',[configuration.testinghome])
except: except:
m=imp.find_module('custom_zodb',[configuration.instancehome]) m=imp.find_module('custom_zodb',[configuration.instancehome])
except: except Exception:
# if there is no custom_zodb, use the config file specified databases # if there is no custom_zodb, use the config file specified databases
DB = dbtab.getDatabase('/', is_root=1) DB = dbtab.getDatabase('/', is_root=1)
else: else:
......
...@@ -108,6 +108,9 @@ class ZopeStarter: ...@@ -108,6 +108,9 @@ class ZopeStarter:
self.shutdown() self.shutdown()
def shutdown(self): def shutdown(self):
databases = getattr(self.cfg.dbtab, 'databases', {})
for db in databases.values():
db.close()
self.unlinkLockFile() self.unlinkLockFile()
self.unlinkPidFile() self.unlinkPidFile()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment