[Zope] Re: Re: dealing with scripts that take too long

2006-01-30 Thread martin f krafft
also sprach Chris Withers [EMAIL PROTECTED] [2006.01.30.1854 +0100]:
 My suggestion would be to use ZEO and Stepper...

Oooh, this is definitely worth a closer inspection. Thanks a lot.

-- 
martin;  (greetings from the heart of the sun.)
  \ echo mailto: !#^.*|tr * mailto:; [EMAIL PROTECTED]
 
invalid/expired pgp (sub)keys? use subkeys.pgp.net as keyserver!
spamtraps: [EMAIL PROTECTED]
 
we are trapped in the belly of this horrible machine,
 and the machine is bleeding to death.
-- godspeed you black emperor!


signature.asc
Description: Digital signature (GPG/PGP)
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] dealing with scripts that take too long

2006-01-25 Thread martin f krafft
Hi there,

we're experiencing problems with certain maintenance scripts, which
just take too long to complete, so that the browser resets the
connection and Zope aborts the transaction.

Short of splitting the scripts up into smaller pieces and running
them individually (which would be a pain), what can we do?

I was thinking we could send data back to the browser, but I cannot
figure out a way to do this from a TTW Python script. How can I send
data immediately, not only when I 'return printed' after all the
processing is done. NPH or so, I believe this was called with plain
CGIs.

Also, I would be interested in how other people approach this
problem. `zopectl run` may be an alternative, but we'd rather not
require filesystem access.

-- 
martin;  (greetings from the heart of the sun.)
  \ echo mailto: !#^.*|tr * mailto:; [EMAIL PROTECTED]
 
invalid/expired pgp (sub)keys? use subkeys.pgp.net as keyserver!
spamtraps: [EMAIL PROTECTED]
 
arrogance on the part of the meritorious is even more
 offensive to us than the arrogance of those without merit:
 for merit itself is offensive.
  -- friedrich nietzsche


signature.asc
Description: Digital signature (GPG/PGP)
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Re: dealing with scripts that take too long

2006-01-25 Thread martin f krafft
also sprach Jonathan [EMAIL PROTECTED] [2006.01.25.2330 +0100]:
 We are running a *nix environment, and use cron with script files that use 
 either perl LWP or CURL to make http requests that invoke the zope 
 methods/scripts. LWP, CURL (and others) give you the ability to control the 
 timeout parameters.

So does wget. The problem is that our users are on Windows machines
without access to or knowledge of a Unix prompt. Thus, NPH would be
a nice way to go about it.

-- 
martin;  (greetings from the heart of the sun.)
  \ echo mailto: !#^.*|tr * mailto:; [EMAIL PROTECTED]
 
invalid/expired pgp (sub)keys? use subkeys.pgp.net as keyserver!
spamtraps: [EMAIL PROTECTED]
 
bill gates, 1984: 640 k ought to be enough
bill gates, 1995: the internet is not a primary goal for pc usage
bill gates, 1999: linux has no impact on microsoft's strategy


signature.asc
Description: Digital signature (GPG/PGP)
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Re: dealing with scripts that take too long

2006-01-25 Thread martin f krafft
also sprach Tino Wildenhain [EMAIL PROTECTED] [2006.01.25.2345 +0100]:
 Actually it does not have anything to do with NPH, but thats another
 story.
 
 You can just write via context.REQUEST.RESPONSE.write(somestring)

This is exactly what I was looking for, I just couldn't remember the
process. I know it's not NPH, but reminiscent of it at least. :)

Thanks to you all for the quick responses!

-- 
martin;  (greetings from the heart of the sun.)
  \ echo mailto: !#^.*|tr * mailto:; [EMAIL PROTECTED]
 
invalid/expired pgp (sub)keys? use subkeys.pgp.net as keyserver!
spamtraps: [EMAIL PROTECTED]
 
a kiss may ruin a human life.
-- oscar wilde


signature.asc
Description: Digital signature (GPG/PGP)
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Re: dealing with scripts that take too long

2006-01-25 Thread martin f krafft
also sprach Jens Vagelpohl [EMAIL PROTECTED] [2006.01.25.2352 +0100]:
 I am assuming you use broken browsers that will time out, like IE?  
 Use a more suitable browser like Firefox, those don't time out by  
 default.

As far as I can remember, Firefox was being used, and it didn't time
out per se (no error), but the script apparently died some way
through; the transaction was aborted.

-- 
martin;  (greetings from the heart of the sun.)
  \ echo mailto: !#^.*|tr * mailto:; [EMAIL PROTECTED]
 
invalid/expired pgp (sub)keys? use subkeys.pgp.net as keyserver!
spamtraps: [EMAIL PROTECTED]
 
humpty was pushed.


signature.asc
Description: Digital signature (GPG/PGP)
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Re: Re: dealing with scripts that take too long

2006-01-25 Thread martin f krafft
also sprach Jens Vagelpohl [EMAIL PROTECTED] [2006.01.26.0002 +0100]:
 If the script dies by itself for some reason then invoking it in  
 other ways might not help. You should concentrate on getting error  
 tracebacks or other evidence that shows *why* the script dies, and go  
 from there.

I have not analysed the scripts myself, but they appear to be bulk
processing jobs. If they use things like objectIds with proper
filters, I don't see how it could fail after n iterations...

But yeah, the scripts need to be checked...

-- 
martin;  (greetings from the heart of the sun.)
  \ echo mailto: !#^.*|tr * mailto:; [EMAIL PROTECTED]
 
invalid/expired pgp (sub)keys? use subkeys.pgp.net as keyserver!
spamtraps: [EMAIL PROTECTED]
 
most people become bankrupt through having invested too heavily in
 the prose of life. to have ruined one's self over poetry is an
 honour.
-- oscar wilde


signature.asc
Description: Digital signature (GPG/PGP)
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope-DB] dealing with dropped database connections

2006-01-22 Thread martin f krafft
also sprach Seth Gottlieb [EMAIL PROTECTED] [2006.01.18.1523 +0100]:
 You might also consider using SQLRelay.  I wrote some blog posts talking 
 about connecting to a relational database.  There might be some useful 
 information there:
 
 http://contenthere.blogspot.com/2005/12/zoracle-part-i-problem.html
 http://contenthere.blogspot.com/2005/12/zoracle-part-ii-solution.html
 http://contenthere.blogspot.com/2005/12/zoracle-part-iii-connecting-zope-to.html

These are very interesting. However, with SQLRelay, I am still bound
to use SQLRelayDA for Zope, and as Charlie postulated that stale
database connections are in part due to Zope's DA framework,
I wonder how using SQLRelay would address the problem; if the
connection to the SQLRelay server is lost, Zope would similarly hang
itself up, wouldn't it?

Or do you recommend running SQLRelay on the Zope server? How does
SQLRelay then manage a connection that is stale?

Thanks,

-- 
martin;  (greetings from the heart of the sun.)
  \ echo mailto: !#^.*|tr * mailto:; [EMAIL PROTECTED]
 
invalid/expired pgp (sub)keys? use subkeys.pgp.net as keyserver!
spamtraps: [EMAIL PROTECTED]
 
women who want to be equal to men lack ambition.
  -- timothy leary


signature.asc
Description: Digital signature (GPG/PGP)
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


[Zope-DB] dealing with dropped database connections

2006-01-17 Thread martin f krafft
Hi,

a client of mine complains about dropped database connections
(SybaseDA), which wreak havoc. For instance, if the network goes
down for a while, the DA is left in an irrecoverable state.

Short of a regular wget to the manage interface to restart the DA,
what can be done? Is this something about SybaseDA (which is no
longer maintained), or a common problem?

What would you advise, short of hunting down the problem and fixing
it?

-- 
martin;  (greetings from the heart of the sun.)
  \ echo mailto: !#^.*|tr * mailto:; [EMAIL PROTECTED]
 
invalid/expired pgp (sub)keys? use subkeys.pgp.net as keyserver!
spamtraps: [EMAIL PROTECTED]
 
the surest way to corrupt a youth is to instruct him to hold in
 higher esteem those who think alike than those who think
 differently.
  -- friedrich nietzsche


signature.asc
Description: Digital signature (GPG/PGP)
___
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db


Re: [Zope-dev] Re: [Zope-Coders] Re: Question about procedures

2005-03-30 Thread martin f krafft
also sprach Chris Withers [EMAIL PROTECTED] [2005.03.30.1513 +0200]:
 You should probably run the unit tests before you commit anything.
 That also means you should write tests to excercise the changes
 you're making, and make sure the tests fail BEFORE you try and fix
 anything.

Okay. Man, this is fun. :)

-- 
martin;  (greetings from the heart of the sun.)
  \ echo mailto: !#^.*|tr * mailto:; [EMAIL PROTECTED]
 
invalid/expired pgp subkeys? use subkeys.pgp.net as keyserver!
spamtraps: [EMAIL PROTECTED]
 
eleventh law of acoustics:
  in a minimum-phase system there is an inextricable link between
  frequency response, phase response and transient response, as they
  are all merely transforms of one another. this combined with
  minimalization of open-loop errors in output amplifiers and correct
  compensation for non-linear passive crossover network loading can
  lead to a significant decrease in system resolution lost. however,
  of course, this all means jack when you listen to pink floyd.


signature.asc
Description: Digital signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Zope-Coders] Re: Question about procedures

2005-03-29 Thread martin f krafft
[moved from -coders to -dev]

First off: I will go with Lennart's suggestion of branches;
I fundamentally agree; I have just never worked on a project where
branches for such petty things aren't overkill. I guess Zope is
a number of magnitudes larger. :)

Now sorry for the noise on zope-coders when this should have been on
zope-dev in the first place.

Now for some of the things that Florent pointed out:

also sprach Florent Guillaume [EMAIL PROTECTED] [2005.03.24.1814 +0100]:
  -if RESPONSE is not None:
  +if RESPONSE is not None and ob:
 
 You should check 'and ob is not None' too.

... but ob is false when it is None, no?

 But why could it be None ? What's the point (sorry I don't have
 context).

Well, I was trying to guard against errors made in other parts of
the code. I know I should not do this. It made things a lot easier
while I was preparing some other patches. Anyway, good thing
I haven't committed. :)

  +if not hasattr(ob, 'absolute_url'):
 
 Do not use hasattr for persistent objects. Use
if getattr(ob, 'absolute_url', None) is None:

Can I read up on the rationale somewhere?

  +  raise TypeError('constructInstance did not return a CMF 
  object.')
 
 Also, check your indentation (should be 4 chars).

Woops.

  -return ob.getId()
  +return getattr(ob, 'id', None)
 
 Please don't do that, getId() is the proper API to call.

Another instance of what to do when ob does not have an getId
method.. you are right, this is wrong.

also sprach Andreas Jung [EMAIL PROTECTED] [2005.03.25.0945 +0100]:
 For changes which are limited to a file or a subtree I do always
 prefer a patch instead of a branch.

I can create a branch and submit patches to you (this is when I wish
zope.org would be using GNU arch). Anyway, since it's probably best
for me not to make changes in the code at present time (being young
in the project and without an assigned field of responsibility),
where do I send potential patches? This list?

-- 
martin;  (greetings from the heart of the sun.)
  \ echo mailto: !#^.*|tr * mailto:; [EMAIL PROTECTED]
 
invalid/expired pgp subkeys? use subkeys.pgp.net as keyserver!
spamtraps: [EMAIL PROTECTED]
 
next the statesmen will invent cheap lies, putting the blame upon the
 nation that is attacked, and every man will be glad of those
 conscience-soothing falsities, and will diligently study them, and
 refuse to examine any refutations of them; and thus he will by and by
 convince himself that the war is just, and will thank god for the
 better sleep he enjoys after this process of grotesque
 self-deception. 
 -- mark twain


signature.asc
Description: Digital signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )