diff options
| author | 2014-07-10 14:45:02 +0000 | |
|---|---|---|
| committer | 2014-07-10 14:45:02 +0000 | |
| commit | acfdf0da6e926b6b38c6ddfb5f9451e047ef456c (patch) | |
| tree | a5c0758ad0e2a1b0c9d3c304c684defacb946fe3 /usr.sbin/smtpd/queue.c | |
| parent | repair prototypes (diff) | |
| download | wireguard-openbsd-acfdf0da6e926b6b38c6ddfb5f9451e047ef456c.tar.xz wireguard-openbsd-acfdf0da6e926b6b38c6ddfb5f9451e047ef456c.zip | |
Improve the scheduler, better and simpler.
- Get rid of the scheduler_batch structure. The scheduler can now return
envelopes of different types in a single run, interlacing them to avoid
batch effects.
- Ask for an acknowledgement from the queue when removing or expiring
an envelope to benefit from the inflight envelope limitation mechanism.
This ensures that the scheduler always keeps sending envelopes at a rate
that the queue can sustain in all cases.
- Limit the number of envelopes in a holdq. When a holdq is full,
new envelopes are put back in the pending queue instead, with a
shorter retry time.
- Plumbing for proc-ified schedulers.
imsg version bump. smtpctl stop before updating.
ok gilles@
Diffstat (limited to 'usr.sbin/smtpd/queue.c')
| -rw-r--r-- | usr.sbin/smtpd/queue.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/queue.c b/usr.sbin/smtpd/queue.c index 4e26fe600c3..889ce104e48 100644 --- a/usr.sbin/smtpd/queue.c +++ b/usr.sbin/smtpd/queue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: queue.c,v 1.163 2014/07/08 15:45:32 eric Exp $ */ +/* $OpenBSD: queue.c,v 1.164 2014/07/10 14:45:02 eric Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -197,9 +197,14 @@ queue_imsg(struct mproc *p, struct imsg *imsg) m_get_evpid(&m, &evpid); m_end(&m); + m_create(p_scheduler, IMSG_QUEUE_ENVELOPE_ACK, 0, 0, -1); + m_add_evpid(p_scheduler, evpid); + m_close(p_scheduler); + /* already removed by scheduler */ if (queue_envelope_load(evpid, &evp) == 0) return; + queue_log(&evp, "Remove", "Removed by administrator"); queue_envelope_delete(evpid); return; @@ -209,6 +214,10 @@ queue_imsg(struct mproc *p, struct imsg *imsg) m_get_evpid(&m, &evpid); m_end(&m); + m_create(p_scheduler, IMSG_QUEUE_ENVELOPE_ACK, 0, 0, -1); + m_add_evpid(p_scheduler, evpid); + m_close(p_scheduler); + /* already removed by scheduler*/ if (queue_envelope_load(evpid, &evp) == 0) return; |
