[Zope-dev] AttributeProvider and type information

2000-10-11 Thread John Eikenberry


I just want to ask a couple quick questions...

First, when using the AttributeProvider class you are pretty much required
to subclass it to add methods for altering the values of the attributes.
Basically I want to be sure I'm not missing something criticle as there
don't seem to be any methods on the default dataskin class for this (as
there are for propertysheets)... and it seems like there should be.

Related to this is dealing with typing information like PropertySheets used
(via the _properties attribute). Wouldn't make sense to keep the
AttributeProvider consistent with this... instead of the simple Attributes
list? Seems like the type information and other meta information would as 
useful for handling attributes on the dataskin as for propertysheets.

-- 

John Eikenberry
[[EMAIL PROTECTED] - http://zhar.net]
__
"A society that will trade a little liberty for a little order
 will deserve neither and lose both."
  --B. Franklin

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] Xron fragility

2000-10-11 Thread Steve Alexander

The Xron product seems rather "fragile" in use.

That is, if things go wrong when an Xron DTML Method is triggered, that
method doesn't get rescheduled.

An example of this is that my intranet DNS server needed to be rebooted.
Xron couldn't look up the appropriate domain name, and stopped working.

--
2000-10-11T08:16:34 PROBLEM(100) Products.Xron.Loggerr 
Trigger event: http://my.development.server:4080/my_xron_method
Trigger time: 2000/10/11 09:14:00 GMT+1
Failed to trigger event.
Type=bci.NotAvailable
Val=host not found (File:
http://my.development.server/my_xron_method/trigger Line: [])
None None for None
--
2000-10-11T08:19:04 PROBLEM(100) Products.Xron.Loggerr Failed to disarm
event


Also, if something bad happens in the Dispatcher thread, the thread
dies.


Before I leap in and start patching Xron, I'd like to have a discussion
about how Xron should handle problems.

My first thought is that on errors in the dispatcher thread, Xron should
enter an "error state" where it probes every so often to see whether it
can resume normal operation. The length of time between probes could
increase with each probe, to give good performance with transient
problems whilst preventing Xron from choking resources. 

--
Steve Alexander
Software Enigneer
Cat-Box limited
http://www.cat-box.net

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Xron fragility

2000-10-11 Thread Chris McDonough

Steve,

I am also interested in scheduling... though I haven't looked closely at
Xron.


 The Xron product seems rather "fragile" in use.

 That is, if things go wrong when an Xron DTML Method is triggered, that
 method doesn't get rescheduled.

Does Xron take an optimistic approach to repeating jobs?  In other words,
does it assume every job is a one-time job and that the last duty that a
repeating job performs is to reschedule itself?

 An example of this is that my intranet DNS server needed to be rebooted.
 Xron couldn't look up the appropriate domain name, and stopped working.

 --
 2000-10-11T08:16:34 PROBLEM(100) Products.Xron.Loggerr
 Trigger event: http://my.development.server:4080/my_xron_method
 Trigger time: 2000/10/11 09:14:00 GMT+1
 Failed to trigger event.
 Type=bci.NotAvailable
 Val=host not found (File:
 http://my.development.server/my_xron_method/trigger Line: [])
 None None for None
 --
 2000-10-11T08:19:04 PROBLEM(100) Products.Xron.Loggerr Failed to disarm
 event


 Also, if something bad happens in the Dispatcher thread, the thread
 dies.

What does the Dispatcher thread do?  Does it fire off worker threads?

 Before I leap in and start patching Xron, I'd like to have a discussion
 about how Xron should handle problems.

 My first thought is that on errors in the dispatcher thread, Xron should
 enter an "error state" where it probes every so often to see whether it
 can resume normal operation. The length of time between probes could
 increase with each probe, to give good performance with transient
 problems whilst preventing Xron from choking resources.

What are other threads in Xron doing while the Dispatcher thread is hosed?
What are the other threads?


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Xron fragility

2000-10-11 Thread Steve Alexander

Chris McDonough wrote:
 
 Steve,
 
 I am also interested in scheduling... though I haven't looked closely at
 Xron.
 
  The Xron product seems rather "fragile" in use.
 
  That is, if things go wrong when an Xron DTML Method is triggered, that
  method doesn't get rescheduled.
 
 Does Xron take an optimistic approach to repeating jobs?  In other words,
 does it assume every job is a one-time job and that the last duty that a
 repeating job performs is to reschedule itself?

It is the Xron DTML Method's responsibility to reschedule itself.
It could be its first duty, however. Then again, as all the work happens
inside a ZODB transaction, it doesn't matter when the reschedule
happens.

 What does the Dispatcher thread do?  Does it fire off worker threads?

Xron has a single dispatcher thread. This thread knows how long to sleep
for until the next job needs to run. It uses Client.py to run a job.
Jobs are Xron DTML Methods. They have a "trigger" method that gets
called through the web from localhost, by the Dispatcher thread.

  Before I leap in and start patching Xron, I'd like to have a discussion
  about how Xron should handle problems.
 
  My first thought is that on errors in the dispatcher thread, Xron should
  enter an "error state" where it probes every so often to see whether it
  can resume normal operation. The length of time between probes could
  increase with each probe, to give good performance with transient
  problems whilst preventing Xron from choking resources.
 
 What are other threads in Xron doing while the Dispatcher thread is hosed?
 What are the other threads?

There are no other threads in Xron.
Xron creates a single thread to do all event dispatching. The work is
done in Zope ZODB threads (or whatever the correct terminology is). The
dispatcher thread communicates with a ZODB thread by using Client to
make a web request.

Xron usually makes requests as the anonymous user. However, I've patched
my Xron to make requests as XronUser by hardcoding (!) the username and
password for that in the RPC.py module of Xron. Then, I've manually
created a XronUser user in my root user folder. I give XronUser the
local roles needed to run methods I want to be scheduled via Xron.

This is not the ideal way to make Xron use authentication. I posted a
proposed design for that to zope-dev in August.

http://lists.zope.org/pipermail/zope-dev/2000-August/006548.html
http://lists.zope.org/pipermail/zope-dev/2000-August/006549.html
http://lists.zope.org/pipermail/zope-dev/2000-August/006550.html

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Better user management: Usership vs. Membership

2000-10-11 Thread Michael Bernstein

Jonas Juselius wrote:
 
 Hello,
 
 I had a look at the Membership product, but I could not get it to work. It
 seems that the PortalMember ZClass in the PortalMembership Product inherits
 from _ZClass_for_LoginUser, which is no longer in the LoginManager...

Were you trying to use Membership with a CVS verson of
LoginManager? Membership 0.7.6 works with LM 0.8.7a and
ZPatterns 0.4.1snap1.

 But
 actually I don't care... I tried to contact Bill about the Membership Prod,
 but he seems to be unreachable because his mail address doesn't work.

Bill just got married, was in the middle of changing network
providers, and his old provider screwed up their IP
addressing (on his wedding day). He says that he'll be back
up Thursday or Friday.

 I found many nice ideas in the Membership product, and I think it would really
 be a good idea to develop it further. Does anybody know about any recent
 developments or what the current status is? Is there going to be a new
 release soon, is anyone even working on the Membership product?

Bill is currently working on re-integrating Membership with
the PTK. I recently found a way of integrating Membership+LM
with the local roles interface. I also modified my copy of
Membership to authenticate off of an NT PDC via SMB from a
Solaris box.

Most LoginManager and Membership discussion happens on the
Zope-PTK mailing list, not Zope-Dev.

Cheers,

Michael Bernstein.

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Xron fragility

2000-10-11 Thread Steve Alexander

Chris McDonough wrote:
 
 As a side note, I do not like the fact that Xron requires you to use special
 DTML methods.  I suppose this is a requirement in this architecture due to
 the fact they need to be autocataloged, but I don't really like that feature
 either :-).

I think Xron could work with anything that has "trigger" and "disarm"
methods, that gets put into the Schedule catalog.


   What does the Dispatcher thread do?  Does it fire off worker threads?
 
  Xron has a single dispatcher thread. This thread knows how long to sleep
  for until the next job needs to run.
 
 Do you think this is this any more effective than having a producer thread
 do a lookup every minute to see what jobs are current, after which it should
 put the current jobs in a queue?

What if you want a small job to be done every 30 seconds?

  It uses Client.py to run a job.
 
 Why is this?  This doesn't make any sense to me on its face.  Why not just
 call the method from a separate thread?

Which separate thread? Do you create a new ZODB thread? That sounds as
if it might use quite a few resources.

Is there a Zope API for making ZODB threads call methods on objects, as
signalled by other threads? I'm guessing the easiest way to do that is
to use Client.py to make a new http request.

 I see... would it be naive if I were to say that I think that a scheduler
 should fire off threads of its own and not rely on an external facility to
 run the jobs?

I'd really like to see a scheduler as a standard part of Zope.
I think it would be good to have scheduled methods called from within
Zope, rather then going through http. I don't know enough about how
ZPublisher/ZODB works to know where to start this though.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Xron fragility

2000-10-11 Thread Chris McDonough

  As a side note, I do not like the fact that Xron requires you to use
special
  DTML methods.  I suppose this is a requirement in this architecture due
to
  the fact they need to be autocataloged, but I don't really like that
feature
  either :-).

 I think Xron could work with anything that has "trigger" and "disarm"
 methods, that gets put into the Schedule catalog.

I guess I'm not real real hot on the dependency on a catalog at all.  I'm
having a hard time imagining a situation where you have so many events that
you need to index them -- especially using a ZCatalog.  It just seems like
too many moving parts and overkill for the job.  :-)

   Xron has a single dispatcher thread. This thread knows how long to
sleep
   for until the next job needs to run.
 
  Do you think this is this any more effective than having a producer
thread
  do a lookup every minute to see what jobs are current, after which it
should
  put the current jobs in a queue?

 What if you want a small job to be done every 30 seconds?

I generally don't... I'm satisfied with cron granularity, although others
might not be.  Do you have this requirement?

   It uses Client.py to run a job.
 
  Why is this?  This doesn't make any sense to me on its face.  Why not
just
  call the method from a separate thread?

 Which separate thread? Do you create a new ZODB thread? That sounds as
 if it might use quite a few resources.

 Is there a Zope API for making ZODB threads call methods on objects, as
 signalled by other threads? I'm guessing the easiest way to do that is
 to use Client.py to make a new http request.

Well... AFAIK, there is no such thing as a ZODB thread... there are a number
of Python threads used by Zope.  We'd just fire off another one to perform a
task as part of the thing that takes an event off the queue.  This might be
naive.  I need to try it.

 I'd really like to see a scheduler as a standard part of Zope.
 I think it would be good to have scheduled methods called from within
 Zope, rather then going through http. I don't know enough about how
 ZPublisher/ZODB works to know where to start this though.

I'll need to try to call get_transaction().commit() from a
manually-constructed Python thread fired off from Zope and see what happens.
I think it'll just work.  I'll find out in a few minutes.  :-)



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Xron fragility

2000-10-11 Thread Chris McDonough

 I'll need to try to call get_transaction().commit() from a
 manually-constructed Python thread fired off from Zope and see what
happens.
 I think it'll just work.  I'll find out in a few minutes.  :-)

Yes, it just works.  :-)



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Xron fragility

2000-10-11 Thread Chris McDonough

  Do you think this is this any more effective than having a producer
thread
  do a lookup every minute to see what jobs are current, after which it
should
  put the current jobs in a queue?  E.g., as the "run" method of a
separate
  producer thread:

 the same problem applies, a solution might be a timer and a signal
 handler to catch a signal event when a new job is entered into the
 system. events could be managed as some sort of collection of linked
 lists (or whatever ds).

I think this problem is solved by:

- polling for "current" events every 60 seconds *exactly on the 0th second
of the
  minute* (this ensures that stopping and starting the scheduler won't
accidently
  cause a "current" repeating event to fire twice).

- allowing one-time events (which are most likely to need to be executed
immediately)
  to be "current" for the minute implied by the event's timestamp as well as
the minute
  just before that one.  This ensures that an event that has a timestamp
that was "current"
  when entered, but has subsequently been passed due to event polling
overhead
  will be executed (even if it is entered at hh:mm:59.999 or similar).  It
also assumes
  that the scheduling poller will never take more than 60 seconds to poll
all events,
  which is a fairly safe assumption.

- the executor of the event is required to invalidate one-time events once
they've
  been executed (or before they're executed) so they don't get fired twice.

I don't believe there is any need for a signal handler or anything of the
sort, the problem seems to just require careful synchronization.

 i played around with this in a monitor thread and you just can't achieve
 the proper semantics to execute an arbitray zope method. you have to
 recreate the request, response as well as have all the required support
 modules (DTML, tracebacks, etc) to successfully call a method, you are
 in essence reduplicating the publishing machinery. i tried to think of a
 way to get around this but i came up short. you can still access
 variables and simple methods.

This would need to be thought through...  the same problem exists for unit
testing.  :-(

  I see... would it be naive if I were to say that I think that a
scheduler
  should fire off threads of its own and not rely on an external facility
to
  run the jobs?

 the dispatcher thread itself has a connection to the ZODB, its using
 client as RPC to invoke the methods on Publishing threads. Since there
 is a hardcoded limit to ZODB connections firing off more connections
 does not seem like a good idea.

AFAIK, threads will block if they can't get a DB connection.  What risks
does that imply?  Is it a problem?




___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Strange permissions in the (built-in) API reference

2000-10-11 Thread Michel Pelletier

Dieter Maurer wrote:
 
 Recently, I read the "Interface Wiki". It covers most of
 the methods contained in the API and its permission descriptions
 made a very solid impression. Maybe, you can start from these
 descriptions.

The Interfaces Wiki is actually where all the API documention did come
from.  Are there inconsistencies?
 
 It might also not be optimal wrt. maintainability
 that the modules, their classes and their methods with
 the respective docstrings have been recreated
 just for API documentation purposes.
 Probably, it would be preferable to use the docstrings
 and the method prototypes from the source directly.
 You might still want to control with methods are described
 in the API and in which order.
 Personally, I would control this, too, inside the source
 documentation (a la javadoc), but I can imagine that an
 external configuration might be advantageous.

Yes, there are pros and cons on both sides, and Amos, Jim and I had some
long converstations about this very subject.  We decided to go with
seperate documentation instead of autogenerating it because:

1. An interface should be a contract, not just an artifact of the code.

2. Python, being without first class support for interfaces, has no
clear way of spelling an interface of a class.

3. Jim is working on formal interface support for python and he's
thinking hard about it, we definatly didn't want to think hard about it
and then turn out we came up with a bad answer, the existing API docs
are just that, docs, not interfaces.  When format interfaces come about,
API docs will probably be converted to that format.

Thanks for the comments!

-Michel

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




[Zope-dev] Inheritable properties(sheets)? Anyone? Anyone? Bueller?

2000-10-11 Thread Alexander Schonfeld
I want to inherit the properties of one zclass in another zclass, but
it seems to cause some namespace clashing... shouldn't this be possible?
Working with the instance of the class is fine, but inter-zclass
inheritance (acquisition?) would be nice...

Am I missing something?
Thanks,

Alex.
 
1010011010101001101010100110101010011010
0  Digital Garage デジタル車庫 :)
1  Alexander Schonfeld
0  [EMAIL PROTECTED] - pear - 03-5454-7219
1  http://www.zope.ne.jp/ http://www.garage.co.jp



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )