summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-11-15 01:11:38 +0000
committerJeremy Allison <jra@samba.org>2000-11-15 01:11:38 +0000
commite8d43bbfe4c05f813a014fd23b8b491ed2d8d4fa (patch)
tree9a766cd2f74470e6f3c5dc6cd5048be8fd752fea
parent4bce271e4fe239a8b4aac2bb65a52165d68d8ea5 (diff)
downloadsamba-e8d43bbfe4c05f813a014fd23b8b491ed2d8d4fa.tar.gz
samba-e8d43bbfe4c05f813a014fd23b8b491ed2d8d4fa.tar.bz2
samba-e8d43bbfe4c05f813a014fd23b8b491ed2d8d4fa.zip
Tuyrn debug timestamps on by default.
Add Tim's lpq race fix. Jeremy. (This used to be commit d43405bc47c95bf8c906035cba23bf95d252d13b)
-rw-r--r--source3/param/loadparm.c2
-rw-r--r--source3/printing/printing.c20
2 files changed, 17 insertions, 5 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 9dcd7bbc2e..cb90f16f6d 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -1213,7 +1213,7 @@ static void init_globals(void)
Globals.bStripDot = False;
Globals.syslog = 1;
Globals.bSyslogOnly = False;
- Globals.bTimestampLogs = False;
+ Globals.bTimestampLogs = True;
Globals.bDebugHiresTimestamp = False;
Globals.bDebugPid = False;
Globals.bDebugUid = False;
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 8b17e8d5f2..2d98aa9974 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -271,11 +271,23 @@ static int traverse_fn_delete(TDB_CONTEXT *t, TDB_DATA key, TDB_DATA data, void
if (jobid == qid) break;
}
+ /* The job isn't in the system queue - we have to assume it has
+ completed, so delete the database entry. */
+
if (i == ts->qcount) {
- /* the job isn't in the system queue - we have to
- assume it has completed, so delete the database
- entry */
- tdb_delete(t, key);
+ time_t cur_t = time(NULL);
+
+ /* A race can occur between the time a job is spooled and
+ when it appears in the lpq output. This happens when
+ the job is added to printing.tdb when another smbd
+ running print_queue_update() has completed a lpq and
+ is currently traversing the printing tdb and deleting jobs.
+ A workaround is to not delete the job if it has been
+ submitted less than lp_lpqcachetime() seconds ago. */
+
+ if ((cur_t - pjob.starttime) > lp_lpqcachetime()) {
+ tdb_delete(t, key);
+ }
}
return 0;