summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2012-03-13 23:07:59 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2012-03-13 23:07:59 +0000
commit3747e8faf370d3345288a31d5c570e25ec4aa6fe (patch)
treee2b479f3a76e316ab28a15330dc4014428a9b5bd /usr.sbin
parent6c1ac428f59679642eb71703006dfe35995931d8 (diff)
When moving back envelope from offload tree to msg tree ... remove the
envelope from offload tree not msg tree, this corrupts the ramqueue in ways that I couldn't imagine before wasting so many hours tracking it. Fixes crash on my server under load, no crash after about 20K mails processed from up to 150 concurrent sessions.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/smtpd/scheduler_ramqueue.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/scheduler_ramqueue.c b/usr.sbin/smtpd/scheduler_ramqueue.c
index 7c57169b4e2..c7643b48d2e 100644
--- a/usr.sbin/smtpd/scheduler_ramqueue.c
+++ b/usr.sbin/smtpd/scheduler_ramqueue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scheduler_ramqueue.c,v 1.5 2012/03/07 22:54:49 gilles Exp $ */
+/* $OpenBSD: scheduler_ramqueue.c,v 1.6 2012/03/13 23:07:58 gilles Exp $ */
/*
* Copyright (c) 2012 Gilles Chehade <gilles@openbsd.org>
@@ -316,12 +316,13 @@ scheduler_ramqueue_insert(struct envelope *envelope)
time_t curtm = time(NULL);
log_debug("scheduler_ramqueue: insert");
+
rq_evp = ramqueue_lookup_offload(envelope->id);
if (rq_evp) {
rq_msg = rq_evp->rq_msg;
rq_batch = rq_evp->rq_batch;
rq_host = rq_evp->rq_host;
- RB_REMOVE(evptree, &rq_msg->evptree, rq_evp);
+ RB_REMOVE(offloadtree, &ramqueue.offloadtree, rq_evp);
}
else {
msgid = evpid_to_msgid(envelope->id);