summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 50d3228)
raw | patch | inline | side by side (parent: 50d3228)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 7 Apr 2004 01:12:26 +0000 (01:12 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 7 Apr 2004 01:12:26 +0000 (01:12 +0000) |
roundup-server uses ForkingMixIn (yay, simultaneous accesses with mysql
and postgresql)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2262 57a73879-2fb5-44c3-a270-3262357dd7e2
and postgresql)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2262 57a73879-2fb5-44c3-a270-3262357dd7e2
diff --git a/CHANGES.txt b/CHANGES.txt
index 200407483be47c77c38faaf567a2b24342899f8a..0e8da9509e156a98465071e42fe5bd3c92b6f9cc 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
- added isset method to HTMLProperty
- database export now exports full journals too
- tracker name at end of page title (sf rfe 926840)
+- roundup-server now uses the ForkingMixin
Fixed:
- web CSV export was busted (as was any action returning a result)
- roundup-admin install checks for existing tracker in target home
- grouping (and sorting) by multilink in RDBMS backends (sf bug 655702)
- roundup scripts may now be asked for their version (sf rfe 798657)
+- sqlite backend had stopped using the global lock
2004-03-27 0.7.0b2
index 0d3d15f0a9ac98479678267208b2b5738339272c..b79d1454d1443ce82924a46280f6b13d9b849fc7 100644 (file)
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-#$Id: back_anydbm.py,v 1.140 2004-04-02 05:58:43 richard Exp $
+#$Id: back_anydbm.py,v 1.141 2004-04-07 01:12:25 richard Exp $
'''This module defines a backend that saves the hyperdatabase in a
database chosen by anydbm. It is guaranteed to always be available in python
versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several
'''
if self.lockfile is not None:
locking.release_lock(self.lockfile)
- if self.lockfile is not None:
self.lockfile.close()
self.lockfile = None
index e2517103e7aa7ee9cd3e51214954f93dd5972f38..f624fa0720492c8679ae58500f06b2bc7aa4a9d8 100644 (file)
-# $Id: back_sqlite.py,v 1.23 2004-03-31 23:08:08 richard Exp $
+# $Id: back_sqlite.py,v 1.24 2004-04-07 01:12:26 richard Exp $
'''Implements a backend for SQLite.
See https://pysqlite.sourceforge.net/ for pysqlite info
import os, base64, marshal
from roundup import hyperdb, date, password
+from roundup.backends import locking
from roundup.backends import rdbms_common
import sqlite
# ensure files are group readable and writable
os.umask(0002)
+ # lock the database
+ lockfilenm = os.path.join(self.dir, 'lock')
+ self.lockfile = locking.acquire_lock(lockfilenm)
+ self.lockfile.write(str(os.getpid()))
+ self.lockfile.flush()
+
(self.conn, self.cursor) = self.sql_open_connection()
try:
connection.
'''
try:
- self.conn.close()
- except sqlite.ProgrammingError, value:
- if str(value) != 'close failed - Connection is closed.':
- raise
+ try:
+ self.conn.close()
+ except sqlite.ProgrammingError, value:
+ if str(value) != 'close failed - Connection is closed.':
+ raise
+ finally:
+ # always release the lock
+ if self.lockfile is not None:
+ locking.release_lock(self.lockfile)
+ self.lockfile.close()
+ self.lockfile = None
def sql_rollback(self):
''' Squash any error caused by us having closed the connection (and
index c14cdf6abf597b70ae1e60422ce2b9333164cac8..8983c6f25b0babb510592ea9cb3688e53045ed00 100644 (file)
"""Command-line script that runs a server over roundup.cgi.client.
-$Id: roundup_server.py,v 1.43 2004-04-05 23:43:04 richard Exp $
+$Id: roundup_server.py,v 1.44 2004-04-07 01:12:26 richard Exp $
"""
__docformat__ = 'restructuredtext'
from roundup import __version__ as roundup_version
import sys, os, urllib, StringIO, traceback, cgi, binascii, getopt, imp
-import BaseHTTPServer, socket, errno
+import SocketServer, BaseHTTPServer, socket, errno
# Roundup modules of use here
from roundup.cgi import cgitb, client
self.send_error(403, self.path)
except:
exc, val, tb = sys.exc_info()
- if hasattr(socket, 'timeout') and exc == socket.timeout:
+ if hasattr(socket, 'timeout') and isinstance(val, socket.timeout):
+ # we can't send socket timeout errors back to the client, duh
s = StringIO.StringIO()
traceback.print_exc(None, s)
self.log_message(str(s.getvalue()))
# obtain server before changing user id - allows to use port <
# 1024 if started as root
address = (hostname, port)
+ server_klass = BaseHTTPServer.HTTPServer
+ class server_klass(SocketServer.ForkingMixIn,
+ BaseHTTPServer.HTTPServer):
+ pass
try:
- httpd = BaseHTTPServer.HTTPServer(address, RoundupRequestHandler)
+ httpd = server_klass(address, RoundupRequestHandler)
except socket.error, e:
if e[0] == errno.EADDRINUSE:
raise socket.error, \