[PATCH] limit client timeout in realtime mode

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] limit client timeout in realtime mode

Florian Paul Schmidt-2

Hi,

currently jackd allows a client timeout greater than the watchdog
timeout, which doesn't make any sense and even makes jack quit if a
client hangs (due to the watchdog kicking in).

This patch checks the specified client timeout so that it is enforced
that it's smaller than  the jack watchdog timeout. Plus it updates the
manpage.

Index: jack/engine.h
===================================================================
--- jack/engine.h (Revision 973)
+++ jack/engine.h (Arbeitskopie)
@@ -52,6 +52,8 @@
     jack_port_buffer_info_t *info; /* jack_buffer_info_t array */
 } jack_port_buffer_list_t;
 
+#define JACKD_WATCHDOG_TIMEOUT 5000
+
 /* The main engine structure in local memory. */
 struct _jack_engine {
     jack_control_t        *control;
Index: jackd/jackd.1.in
===================================================================
--- jackd/jackd.1.in (Revision 973)
+++ jackd/jackd.1.in (Arbeitskopie)
@@ -86,8 +86,8 @@
 .TP
 \fB\-t, \-\-timeout \fIint\fR
 .br
-Set client timeout limit in milliseconds.  The default is 500 msec
-when not in realtime mode (see: \-R).
+Set client timeout limit in milliseconds.  The default is 500 msec.
+In realtime mode the client timeout must be smaller than the watchdog timeout (5000 msec).
 .TP
 \fB\-u, \-\-unlock\fR
 .br
Index: jackd/engine.c
===================================================================
--- jackd/engine.c (Revision 973)
+++ jackd/engine.c (Arbeitskopie)
@@ -899,7 +899,7 @@
  engine->watchdog_check = 0;
 
  while (1) {
- sleep (5);
+ usleep (1000 * JACKD_WATCHDOG_TIMEOUT);
  if (!engine->freewheeling && engine->watchdog_check == 0) {
 
  jack_error ("jackd watchdog: timeout - killing jackd");
Index: jackd/jackd.c
===================================================================
--- jackd/jackd.c (Revision 973)
+++ jackd/jackd.c (Arbeitskopie)
@@ -614,7 +614,7 @@
  break;
 
  default:
- fprintf (stderr, "unknown option character %c\n",
+ fprintf (stderr, "Unknown option character %c\n",
  optopt);
  /*fallthru*/
  case 'h':
@@ -631,6 +631,12 @@
  return -1;
  }
 
+ if (realtime && (client_timeout >= JACKD_WATCHDOG_TIMEOUT)) {
+ usage (stderr);
+ fprintf (stderr, "In realtime mode (-R) the client timeout must be smaller than the watchdog timeout (%ims).\n", JACKD_WATCHDOG_TIMEOUT);
+ exit (1);
+ }
+
  if (!seen_driver) {
  usage (stderr);
  exit (1);


--
Palimm Palimm!
http://tapas.affenbande.org


_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel

jack-timeout.diff (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Jack-devel] [PATCH] limit client timeout in realtime mode

Florian Paul Schmidt-2
On Fri, 9 Jun 2006 17:12:38 +0200
Florian Paul Schmidt <[hidden email]> wrote:

>
> Hi,
>
> currently jackd allows a client timeout greater than the watchdog
> timeout, which doesn't make any sense and even makes jack quit if a
> client hangs (due to the watchdog kicking in).
>
> This patch checks the specified client timeout so that it is enforced
> that it's smaller than  the jack watchdog timeout. Plus it updates the
> manpage.

Seems nobody cares for this fix. To restate the problem: jackd will get
killed [taking your whole session with it] if a single client hangs
_and_ if you have specified a timeout larger than the watchdog timeout
[which is hardcoded and pretty much invisible to the user].

Flo

--
Palimm Palimm!
http://tapas.affenbande.org


_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Jack-devel] [PATCH] limit client timeout in realtime mode

rj (Bugzilla)
Hi,

On Tuesday 20 June 2006 19:46, Florian Paul Schmidt wrote:

> On Fri, 9 Jun 2006 17:12:38 +0200
>
> Florian Paul Schmidt <[hidden email]> wrote:
> > Hi,
> >
> > currently jackd allows a client timeout greater than the watchdog
> > timeout, which doesn't make any sense and even makes jack quit if a
> > client hangs (due to the watchdog kicking in).
> >
> > This patch checks the specified client timeout so that it is enforced
> > that it's smaller than  the jack watchdog timeout. Plus it updates the
> > manpage.
>
> Seems nobody cares for this fix.

Speaking as a user I care tremendously about this fix. It has happened to me
more than once.
It's quite easy to trigger, just ctrl-c in an app that does not catch ctrl-c,
which is probably almost all.
Since jack dies it's likely your setup dies with it, no good.

> To restate the problem: jackd will get
> killed [taking your whole session with it] if a single client hangs
> _and_ if you have specified a timeout larger than the watchdog timeout
> [which is hardcoded and pretty much invisible to the user].
>
> Flo

/Robert

ps.
are there two mailinglists now?
ds.

--
http://spamatica.se/musicsite/


_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Jack-devel] [PATCH] limit client timeout in realtime mode

Jack O'Quin
In reply to this post by Florian Paul Schmidt-2
On 6/20/06, Florian Paul Schmidt <[hidden email]> wrote:

> On Fri, 9 Jun 2006 17:12:38 +0200
> Florian Paul Schmidt <[hidden email]> wrote:
>
> >
> > Hi,
> >
> > currently jackd allows a client timeout greater than the watchdog
> > timeout, which doesn't make any sense and even makes jack quit if a
> > client hangs (due to the watchdog kicking in).
> >
> > This patch checks the specified client timeout so that it is enforced
> > that it's smaller than  the jack watchdog timeout. Plus it updates the
> > manpage.
>
> Seems nobody cares for this fix. To restate the problem: jackd will get
> killed [taking your whole session with it] if a single client hangs
> _and_ if you have specified a timeout larger than the watchdog timeout
> [which is hardcoded and pretty much invisible to the user].

Your patch looks good to me.  You even updated the man page, what
more could we ask?

Committed [0.102.17], SVN -r978.
--
 joq


_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel