cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Lon Hohberger <lhh@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] rind-0.8.1 patch
Date: Wed, 06 Feb 2008 12:01:34 -0500	[thread overview]
Message-ID: <1202317294.21504.50.camel@ayanami.boston.devel.redhat.com> (raw)
In-Reply-To: <200802061003.24749.grimme@atix.de>

On Wed, 2008-02-06 at 10:03 +0100, Marc Grimme wrote:
> On Tuesday 05 February 2008 18:58:25 Lon Hohberger wrote:

> > <events search_path="/usr/share/cluster:/usr/local/cluster:..." />
> >    <!-- for example -->
> >    ...
> > </events>

> Ah got it. I wasn't aware of evalfile. But wouldn't filetags work around the 
> searchpath problem and being pretty easy to implement?

I don't see searchpaths as a problem, and in fact, I might not have to
fix it anyway (yay!).  Turns out, this works, too (I thought it didn't
for some reason):

  evalfile("/tmp/lon.sl");
  lon_function();

/tmp/lon.sl:

  evalfile("/root/foo.sl");
  define lon_function()
  {
    foo_function();
    printf("Hello, world!\n");
  }

/root/foo.sl:

  define foo_function()
  {
    foo_function();
    printf("Test\n");
  }


> > (However, I don't consider this critical...)
> It's not critical but could help make the development of those sl-files more 
> general.

Given that absolute paths also work, does this satisfy the requirement?
I really can't see adding more parsing code for something S-Lang already
does.

I mean, it's not -that- hard to add, but it's kind of pointless to do:

  <event>
    <file "/rgmanager/slang-scripts/foo1.sl"/>
    <file "/rgmanager/slang-scripts/foo2.sl"/>
    script_body();
  </event>

instead of:

  <event>
    evalfile("/rgmanager/slang-scripts/foo1.sl");
    evalfile("/rgmanager/slang-scripts/foo2.sl");
    script_body();
  </event>


> > Note that the reason I was calling external scripts is because there's a
> > limit in ccsd on the amount of data you can get back from ccs_get() -
> > it's a couple hundred bytes.  So, embedding an entire script won't work,
> > but a shorty script like the one you made should work.
> And you can independently develop sl-scripts from the cluster.conf. So you 
> don't need a new version number anytime you change the sl-file. Besides you 
> could build up libraries (on example is follow-service) to be used general.

That's also a benefit (and using evalfile() in your code instead of
embedding the equivalent in cluster.conf also is coincides with this).


> > > +               if (membership->cml_members[i].cn_member > 0 &&
> > > But I'm not sure if this is right. For me it worked perfectly well ;-) .
> >
> > That's strange... I'll look at that.  That *needs* to work. :)
> Right that should not be a difference shouldn't it. ;-)

Definitely not. :)


One thing I think's missing is intelligence about event collapsing in
default_event_handler.  For example, if a service fails and you restart
it, but restart fails, so you move it to another node (all in a single
event handler execution), we get 5-ish events for that:

 * failure event
 * stopped event
 * start event
 * stopped event
 * start event

The middle 3 events become irrelevant.  We could fix it in
default_event_script.sl by checking the current state and if the current
state doesn't match the event, throwing it out.  (I think throwing them
out for user-defined event scripts is a bad idea, however, which is why
I suggested changing it in default_event_handler).

This could also be a good 'library' function (as could several of the
functions in default_event_handler.sl).

-- Lon



  reply	other threads:[~2008-02-06 17:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-30 16:49 [Cluster-devel] rind-0.8.1 patch Lon Hohberger
2008-02-04 17:41 ` Marc Grimme
2008-02-05 17:58   ` Lon Hohberger
2008-02-06  9:03     ` Marc Grimme
2008-02-06 17:01       ` Lon Hohberger [this message]
2008-02-06 17:22         ` Lon Hohberger
2008-02-06 19:18         ` Marc Grimme
2008-02-07  8:38         ` Marc Grimme
2008-02-08 20:56           ` Lon Hohberger
2008-02-14 21:56   ` Lon Hohberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1202317294.21504.50.camel@ayanami.boston.devel.redhat.com \
    --to=lhh@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).