[Zope-dev] Parameter referencing bug in Python Scripts?
Hmmm, There seems to be a bug in the way parameters are referenced in python scripts. I have a simple script that has a list as a default parameter. The script then appends something to this list and returns the list. Each time I call the script the list gets to be one element longer. Here is an example script: ## Script (Python) "pyFix" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=a=['a'] ##title= ## a.append('b') return a The output from the script is as follows: 1st call: ['a','b'] 2nd call: ['a','b','b'] 3rd call: ['a','b','b','b'] 4th call: ['a','b','b','b','b'] etc. It seems that I'm getting a reference to the default parameter which I then modify for future calls. Currently I'm getting around this by having list parameters default to none and then setting the defaults within the script. I have some security concerns since I can change the default parameters for other users on the server. Or so it seems. Suggestions? Brian Brinegar Engineering Computer Network Purdue University ___ Zope-Dev maillist - [EMAIL PROTECTED] 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] UndoSearch Timeout
Hello, We have a ZODB which is about 12 - 14 gigs when packed. We use FileStorage, and when anyone clicks Undo eventually times out. This is better now that the undoLog does not lock the database. However if there are not enough transactions to fill the batch Undo is useless. So, everytime we upgrade to a new version of Zope I patch FileStorage.py to add a timeout. Used to be 3 seconds when the ZODB locked, now I've bumped it up to 10 seconds. Has anyone else had this problem? Would adding the timeout, possibly set by an environment variable, be considered by the maintainers? Thanks, Brian Brinegar Engineering Computer Network (ECN) Purdue University ___ Zope-Dev maillist - [EMAIL PROTECTED] 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] Object Type Assocation And Death To index_html
Hello All, There is a proposal in the Zope 2.6 plan called "Object Type Assocation and Death To index_html" the status listed is "incomplete". Is this still on the table for future versions of Zope? If part of the proposal was implemented what parts? http://dev.zope.org/Wikis/DevSite/Proposals/ObjectTypeAssociationAndDeathToIndexHtml Thanks, -Brian ___ Zope-Dev maillist - [EMAIL PROTECTED] 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: Untrusted developers
Just being able to kill processes when their requests have been terminated would improve the situation dramatically. It would also allow termination policies to be implemented in the front-end server (Apache). This would not be as nice as the suggestion you made, but we could whip up a simple solution quickly. Can you programmatically determine when a process is associated with a terminated request or is it a fuzzy exercise (like watching "top" for awhile)? Do you use /Control_Panel/DebugInfo? When you find it, is it sufficient and safe to just kill it? --kyler I'm not sure if there is a way to know if the request has been terminated, but if you could killing the thread should work. I think Zope creates new threads until the maximum set in the start script is reached. If one was killed I would assume that Zope would just start up another one the next time it is needed until the maximum is again reached. This would greatly reduce the problem I agree. -Brian ___ Zope-Dev maillist - [EMAIL PROTECTED] 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] Untrusted developers
Howdy, I work with a Zope deployment at a University. Each school has a folder within the Zope deploy where they have complete control. We allow each student, staff, and faculty member to have their own personal folder. One of the problems with this is that users can write a script which loops indefinitely. When a script gets stuck in a loop it bogs down the ZEO client running it until the system kills that python process. Usually this is because someone is developing something new, when it doesn't work they make a change and try it again. Eventually all of the ZEO Clients are hung and everything is slow (and Zope looks bad to the bosses because this didn't happen with apache.) What I would like to see is a timeout associated with code objects (Python Scripts, Page Templates) that is set to some small value like 10 seconds by default. If the script does not complete within the timeout Zope would raise an exception. The user could bump up the timeout if they are writing something time intensive on purpose, but they wouldn't kill the whole web server (and important web pages) during development. Has anything like this been considered previously? Is it something that would ever make it into a zope release if I was to work on a patch? Thank you, Brian Brinegar Engineering Computer Network Purdue University ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 )
Re: [Zope-dev] WebDAV File Descriptor Leak
It seems to occur when WebDAV clients initially connect, not during file transfer. I was able to produce the problem with Cadaver as well as several other WebDAV clients. -Brian Andreas Jung wrote: I checked the corresponding code and the temporary files should be closed automatically when the upload was successful (the __del__() method of the TemporaryFile class closes the file). The leak might come from unfinished uploads. In this case the iTemporaryFile instance is not destroyed. -aj --On Mittwoch, 28. Mai 2003 22:27 Uhr +0200 Dieter Maurer <[EMAIL PROTECTED]> wrote: Andreas Jung wrote at 2003-5-27 18:11 +0200: > Can you reproduce the behaviour with 2.6.2? We have the same problem with 2.6.1 without WebDAV. Thus, the problem is probably not WebDAV related (but rather related to file uploading). Dieter ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 maillist - [EMAIL PROTECTED] 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 )
Re: [Zope-dev] WebDAV File Descriptor Leak
Andreas, Rather than waiting to setup a new ZEO to test this out I decided to poke around at the linux releases that are available. I was able to reproduce our problem using the 2.5.1 release as well as the 2.6.0 release. It appears to be fixed in the 2.6.2b1 release. Until we are able to move to 2.6.2 I will work on a way of monitoring this on or production server. Thank you, Brian Brinegar ECN Web Systems Developer Purdue University Andreas Jung wrote: --On Dienstag, 27. Mai 2003 11:26 Uhr -0500 Brian Brinegar <[EMAIL PROTECTED]> wrote: Don't have a 2.6.2 setup right now. It will take it a while for us to get a system running Zope 2.6.2 up. Though we are planning to migrate to Zope 2.6.2 in early July. Are there changes in Zope 2.6.2 that would effect this? No idea but there have been a bunch of changes so it might be fixed. I do not want to spent too much time for bug hunting in older versions. -aj ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 )
Re: [Zope-dev] WebDAV File Descriptor Leak
Don't have a 2.6.2 setup right now. It will take it a while for us to get a system running Zope 2.6.2 up. Though we are planning to migrate to Zope 2.6.2 in early July. Are there changes in Zope 2.6.2 that would effect this? -Brian Andreas Jung wrote: Can you reproduce the behaviour with 2.6.2? -aj --On Dienstag, 27. Mai 2003 11:07 Uhr -0500 Brian Brinegar <[EMAIL PROTECTED]> wrote: Hello, We've run into a problem where we get messages like this in our Zope logs: 2003-05-23T18:56:08 PROBLEM(100) ZServer Server accept() threw an exception we occasionally get a lot of these and then restart Zope on the ZEO Client and everything is okay. After a little more investigation we found that these occur when we run out of File Descriptors. So, why are we running out of file descriptors??? Tracked it down to this: each time a WebDAV client connects to zope cluster a temporary file is created. lsof shows the following: python19005 httpd 1016u REG0,9 227 15857725 [EMAIL PROTECTED] (deleted) python19005 httpd 1017u REG 0,9 227 15857727 [EMAIL PROTECTED] (deleted) python19005 httpd 1018u REG0,9 227 15857732 [EMAIL PROTECTED] (deleted) python19005 httpd 1019u REG0,9 227 15857738 [EMAIL PROTECTED] (deleted) python19005 httpd 1020u REG 0,9 227 15857740 [EMAIL PROTECTED] (deleted) python19005 httpd 1021u REG0,9 227 15857743 [EMAIL PROTECTED] (deleted) python19005 httpd 1022u REG0,9 227 15857745 [EMAIL PROTECTED] (deleted) python19005 httpd 1023u REG 0,9 227 15857886 [EMAIL PROTECTED] (deleted) they are all roughly the same size. There seems to be a file descriptor leak. Is this a known problem? We are running Zope 2.5.1 right now. Any ideas? Thanks, -Brian ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 maillist - [EMAIL PROTECTED] 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] WebDAV File Descriptor Leak
Hello, We've run into a problem where we get messages like this in our Zope logs: 2003-05-23T18:56:08 PROBLEM(100) ZServer Server accept() threw an exception we occasionally get a lot of these and then restart Zope on the ZEO Client and everything is okay. After a little more investigation we found that these occur when we run out of File Descriptors. So, why are we running out of file descriptors??? Tracked it down to this: each time a WebDAV client connects to zope cluster a temporary file is created. lsof shows the following: python19005 httpd 1016u REG0,9 227 15857725 [EMAIL PROTECTED] (deleted) python19005 httpd 1017u REG0,9 227 15857727 [EMAIL PROTECTED] (deleted) python19005 httpd 1018u REG0,9 227 15857732 [EMAIL PROTECTED] (deleted) python19005 httpd 1019u REG0,9 227 15857738 [EMAIL PROTECTED] (deleted) python19005 httpd 1020u REG0,9 227 15857740 [EMAIL PROTECTED] (deleted) python19005 httpd 1021u REG0,9 227 15857743 [EMAIL PROTECTED] (deleted) python19005 httpd 1022u REG0,9 227 15857745 [EMAIL PROTECTED] (deleted) python19005 httpd 1023u REG0,9 227 15857886 [EMAIL PROTECTED] (deleted) they are all roughly the same size. There seems to be a file descriptor leak. Is this a known problem? We are running Zope 2.5.1 right now. Any ideas? Thanks, -Brian ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 )
Re: [Zope-dev] REQUEST.args
Okay, After some more poking around, I've simplified the problem. I have a product I created with a __call__ method: def __call__(self, client=None, REQUEST={}, RESPONSE=None, **kw): """ Call the selected template in the context of myself. """ print "REQUEST = " print str(REQUEST) When this is called from DTML like this: REQUEST is {} when this is called directly REQUEST is the real request information, when it is called from python "object(context, REQUEST)" this works as well. Any idea why it does not work as desired when calling like I can create a python script or another dtml method and call those from a dtml method without any arguments and the REQUEST is available. These other products seem to include the func_code stuff to make the documents methodish? Could that have anything to do with my problem? Thanks, -Brian Brian Brinegar wrote: Hi, I'm using some of Casey Duncans code that I got off of zopelabs.com in a product that I created. The code allows you to call any object generically. The code is listed below this message. The problem I have is if my object is called from a DTML Method like the "args" attribute of the REQUEST object disappears and I get an attribute error. I can call it like this and it will work. Anyway, somewhere the REQUEST object is changing. Any ideas? Thanks, -Brian import Acquisition from ZPublisher.mapply import mapply from ZPublisher.Publish import call_object, missing_name, dont_publish_class class MyClass(Acquisition.Implicit,...): ... def __init__(self, some_object_id): self.data_source_id = some_object_id def index_html(self, REQUEST, RESPONSE): object = getattr(self.aq_parent, self.data_source_id) result = mapply(object, REQUEST.args, REQUEST, call_object,1, missing_name, dont_publish_class, REQUEST, bind=1) ...process the result... return result ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 ) Brian Brinegar wrote: Hi, I'm using some of Casey Duncans code that I got off of zopelabs.com in a product that I created. The code allows you to call any object generically. The code is listed below this message. The problem I have is if my object is called from a DTML Method like the "args" attribute of the REQUEST object disappears and I get an attribute error. I can call it like this and it will work. Anyway, somewhere the REQUEST object is changing. Any ideas? Thanks, -Brian import Acquisition from ZPublisher.mapply import mapply from ZPublisher.Publish import call_object, missing_name, dont_publish_class class MyClass(Acquisition.Implicit,...): ... def __init__(self, some_object_id): self.data_source_id = some_object_id def index_html(self, REQUEST, RESPONSE): object = getattr(self.aq_parent, self.data_source_id) result = mapply(object, REQUEST.args, REQUEST, call_object,1, missing_name, dont_publish_class, REQUEST, bind=1) ...process the result... return result ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 maillist - [EMAIL PROTECTED] 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] REQUEST.args
Hi, I'm using some of Casey Duncans code that I got off of zopelabs.com in a product that I created. The code allows you to call any object generically. The code is listed below this message. The problem I have is if my object is called from a DTML Method like the "args" attribute of the REQUEST object disappears and I get an attribute error. I can call it like this and it will work. Anyway, somewhere the REQUEST object is changing. Any ideas? Thanks, -Brian import Acquisition from ZPublisher.mapply import mapply from ZPublisher.Publish import call_object, missing_name, dont_publish_class class MyClass(Acquisition.Implicit,...): ... def __init__(self, some_object_id): self.data_source_id = some_object_id def index_html(self, REQUEST, RESPONSE): object = getattr(self.aq_parent, self.data_source_id) result = mapply(object, REQUEST.args, REQUEST, call_object,1, missing_name, dont_publish_class, REQUEST, bind=1) ...process the result... return result ___ Zope-Dev maillist - [EMAIL PROTECTED] 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 )