Your message dated Sat, 27 May 2023 05:04:07 +0000
with message-id <[email protected]>
and subject line Bug#1036316: Removed package(s) from unstable
has caused the Debian Bug report #227418,
regarding vrrpd : vrrpd should be soft realtime scheduled on kernels that
support it
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
227418: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=227418
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: vrrpd
Version: 0.7-2
Severity: normal
vrrpd could benefit from the SCHED_RR scheduler option wich will make it
catch all HELLOs even on very busy servers.
Attached is a patch (diff -Naur) that will just implement this.
Pascal Lengard
diff -Naur vrrpd-0.7d-cm/Changes vrrpd-0.7e-sched/Changes
--- vrrpd-0.7d-cm/Changes 2004-01-09 13:51:51.000000000 +0100
+++ vrrpd-0.7e-sched/Changes 2004-01-09 14:11:27.000000000 +0100
@@ -1,3 +1,9 @@
+- Pascal Lengard : lock process in memory and ask for SCHED_RR scheduling
priority
+ this should ensure that we do not miss VRRP announces on busy
+ boxes.
+
+ Modified files: vrrpd.c
+
- Pascal Lengard : counter measures
when we are not using vrrp mac address (we use physical mac),
master node HAS to be the last one who broadcast ARP for IP
diff -Naur vrrpd-0.7d-cm/vrrpd.c vrrpd-0.7e-sched/vrrpd.c
--- vrrpd-0.7d-cm/vrrpd.c 2004-01-09 13:57:52.000000000 +0100
+++ vrrpd-0.7e-sched/vrrpd.c 2004-01-09 13:17:20.000000000 +0100
@@ -13,6 +13,10 @@
*
* Changes:
* Pascal Lengard
+ * <+> lock process in memory and ask kernel for SCHED_RR
+ * scheduling so that we do not miss HELLOs on very
+ * busy boxes.
+ * Pascal Lengard
* <+> Use counter measures when detecting that slave pretends
* to take the service whereas it should not.
* this is only necessary when using physical MAC address
@@ -71,6 +75,8 @@
#include <ctype.h>
#include <string.h>
#include <syslog.h>
+#include <sched.h>
+#include <sys/mman.h>
#include <fcntl.h>
#include <getopt.h>
@@ -159,8 +165,109 @@
}
/****************************************************************
- NAME : external_script
+ NAME : stack_hogger
AIM :
+ REMARK : borrowed from heartbeat project
+****************************************************************/
+#define HOGRET 0xff
+
+static int stack_hogger(char * inbuf, int kbytes)
+{
+#ifdef _POSIX_MEMLOCK
+ unsigned char buf[1024];
+
+ if (inbuf == NULL) {
+ memset(buf, HOGRET, sizeof(buf));
+ }else{
+ memcpy(buf, inbuf, sizeof(buf));
+ }
+
+ if (kbytes > 0) {
+ return stack_hogger(buf, kbytes-1);
+ }else{
+ return buf[sizeof(buf)-1];
+ }
+#else
+ return HOGRET;
+#endif
+}
+
+/****************************************************************
+ NAME : make_realtime
+ AIM : lock memory and ask scheduler for soft realtime
+ REMARK : code borrowed (and modified) from heartbeat project
+****************************************************************/
+
+/*
+ * Make us behave like a soft real-time process.
+ * We need scheduling priority and being locked in memory.
+ * If you ask us nicely, we'll even grow the stack and heap
+ * for you before locking you into memory ;-).
+ */
+void make_realtime(int spolicy, int priority, int heapgrowK)
+{
+
+ struct sched_param sp;
+ int staticp;
+
+ if (priority < 0) {
+ priority = sched_get_priority_min(spolicy);
+ }
+
+ if (priority > sched_get_priority_max(spolicy)) {
+ priority = sched_get_priority_max(spolicy);
+ }
+
+
+ if ((staticp=sched_getscheduler(0)) < 0) {
+ syslog (LOG_WARNING,"WARNING: unable to get scheduler
parameters.\n");
+ }else{
+ memset(&sp, 0, sizeof(sp));
+ sp.sched_priority = priority;
+
+ if (sched_setscheduler(0, spolicy, &sp) < 0) {
+ syslog (LOG_ERR,"ERROR: unable to set scheduler
parameters.\n");
+ }
+ }
+
+#ifdef _POSIX_MEMLOCK
+
+ if (heapgrowK > 0) {
+ /*
+ * Try and pre-allocate a little memory before locking
+ * ourselves into memory...
+ */
+ void* mval = malloc(heapgrowK*1024);
+ int ret;
+
+ if (mval != NULL) {
+ memset(mval, 0, heapgrowK*1024);
+ free(mval);
+ }else{
+ syslog(LOG_INFO, "Could not preallocate (%d)
bytes\n",heapgrowK);
+ }
+ if ((ret=stack_hogger(NULL, heapgrowK)) != HOGRET) {
+ syslog(LOG_INFO, "Stack hogger failed 0x%x\n",ret);
+ }
+ }
+
+ if (heapgrowK >=0) {
+ if (mlockall(MCL_CURRENT|MCL_FUTURE) < 0) {
+ syslog(LOG_ERR,"Unable to lock process in memory\n");
+ }else{
+ syslog(LOG_INFO, "process locked in memory
correctly.\n");
+ }
+ }
+#else
+#error MEMLOCK not available
+#endif
+}
+
+
+
+/****************************************************************
+ NAME : external_script
+ AIM : lower scheduling before system() call
REMARK :
****************************************************************/
void external_script(char * state_string, int vrid )
@@ -173,10 +280,13 @@
if ( fork_rc == -1 ) {
syslog (LOG_ERR,"could not fork to launch vrrp_switch !!!\n");
} else if ( fork_rc == 0 ) {
- // FIXME: will have to watch scheduling and signals that are
inherited here.
+ // restore normal scheduling in the son since scheduling is
+ // inherited and we don't want to have EXTERNAL_SCRIPT get it.
+ make_realtime(SCHED_OTHER,0,-1);
- // restore default since otherwise behaviour is not defined by
POSIX
- // (SIGCHLD is set to SIG_IGN in main process)
+
+ // restore default signal handling since we want to get return
code
+ // and behaviour is not defined by POSIX with SIG_IGN.
signal( SIGCHLD, SIG_DFL );
if (snprintf(command, (size_t) EXTERNAL_SCRIPT_MAX,
@@ -1690,6 +1800,9 @@
// Tell the syslog we're starting
syslog(LOG_NOTICE, "Starting (adver_int: %d, vrid: %d, use virtual mac:
%s)", vsrv->adver_int,vsrv->vrid, vsrv->no_vmac ? "no" : "yes" );
+ /* realtime scheduling */
+ make_realtime(SCHED_RR,-1,32);
+
/* main loop */
while( 1 ){
--- End Message ---
--- Begin Message ---
Version: 1.0-2+rm
Dear submitter,
as the package vrrpd has just been removed from the Debian archive
unstable we hereby close the associated bug reports. We are sorry
that we couldn't deal with your issue properly.
For details on the removal, please see https://bugs.debian.org/1036316
The version of this package that was in Debian prior to this removal
can still be found using https://snapshot.debian.org/.
Please note that the changes have been done on the master archive and
will not propagate to any mirrors until the next dinstall run at the
earliest.
This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
[email protected].
Debian distribution maintenance software
pp.
Scott Kitterman (the ftpmaster behind the curtain)
--- End Message ---