Re: [Zope] zopectl does not terminate

2009-03-17 Thread Hedley Roos
Hi Tres!

Thanks for the tips. I managed to get my script running in batches and
with manual intervention. When in future I encounter the same problems
I'll report back to this thread.

Hedley
___
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] zopectl does not terminate

2009-03-17 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hedley Roos wrote:
> Hi all
> 
> I run my script foo.zctl with "zopectl run foo.ctl param1 param2".
> This script operates on a large ZODB and catches ConflictErrors
> accordingly. It iterates over a set, updates data and commits the
> transaction every 100 iterations. But I've noticed two things:
> 
> 1. ConflictErrors are never fully caught. The show up in the console
> (this is acceptable I suppose), but my script stops executing on the
> conflict and does not continue. The zope process stays alive.

Your script has to do the following when interrupted by a ConflictError:

 - abort the current transaction
 - sync its database connection (to pick up the changed objects)
 - re-do the work it was trying to commit (that last 100 updates).

> 2. In the event of no conflict errors my script executes its last line
> (print 'done') but the process does not always terminate.

You may need to wait longer:  a commit can get blocked for a period.

> If I instruct my script to not update the ZODB at all it terminates
> without problems. I'm running it on a live site with 7 ZEO clients.
> I've stopped a client (say client 2) so it is not accessed
> concurrently and run my script with client2/zopectl. It is in fact a
> Plone site but that should be irrelevant.

Long-running ZODB-updating scripts are pretty hard to get right.  I hope
the dance outlined above helps.


Tres.
- --
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJv+fO+gerLs4ltQ4RAsUKAJ95OJvb/pH1hqn2DlyJNlxrP/KuEgCgvOsa
TaUIrLs0Vm7jRWjMST0zh+E=
=3kvF
-END PGP SIGNATURE-

___
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] Reconnection session_data to own Session.fs storage

2009-03-17 Thread Allen Schmidt Sr.
I ran the debug to verify the mount point and got this:

 >>> folder.__dict__['session_data']

 >>>


And in the session_folder object in the root, the session_data objects 
shows as a TransientObjectContainer and not a ZODB Mount Point.



Dieter Maurer wrote:
> Allen Schmidt Sr. wrote at 2009-3-5 10:34 -0500:
>> Somehow, and not sure how, our session_data objects got deleted. No one 
>> admits doing it so no idea what happened.
>> I recreated the objects with the same IDs and even setup the ZODB mount 
>> point to point to the right parts. But our SESSION calls won't write the 
>> the separate Session.fs storage and it writes every SESION usage to our 
>> main Data.fs as an anon transaction.
>>
>> We are on 2.8.10 running ZEO on one server and 5 zope clients on two 
>> other servers. The Session.fs file sits along with the Data.fs file but 
>> never gets used.
>>
>> Any idea how to reconnect the parts again?
> 
> The so called "session_data_manager" tells Zope where the
> "session_data" is located.
> 
> Apparently, your "session_data_manager" does not look at
> the place of your mount point or your mount point does not work/is not
> active.
> 
> First verify the "session_data_manager" configuration (this easy -- look
> in the ZMI).
> If this is correct, verify the mount point.
> That is not so easy. The best way is to start an interactive
> Python interpreter ("bin/zopectl debug" on *nix).
> Then use
> 
>  folder = app.unrestrictedTraverse('path_to_folder_containing_the_mount')
>  folder._p_activate() # load the folder
>  folder.__dict__['Id_of_your_mount_point']
> 
> You should see an "ZODBMountPoint" (or something along this lines).
> 
> If you really see a mount point, verify its configuration
> (that's easy again -- thus, you can do that before the more
> difficult step): is the mount point really in the storage you want?
> 
> 
> 
___
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] zopectl does not terminate

2009-03-17 Thread Hedley Roos
Hi all

I run my script foo.zctl with "zopectl run foo.ctl param1 param2".
This script operates on a large ZODB and catches ConflictErrors
accordingly. It iterates over a set, updates data and commits the
transaction every 100 iterations. But I've noticed two things:

1. ConflictErrors are never fully caught. The show up in the console
(this is acceptable I suppose), but my script stops executing on the
conflict and does not continue. The zope process stays alive.
2. In the event of no conflict errors my script executes its last line
(print 'done') but the process does not always terminate.

If I instruct my script to not update the ZODB at all it terminates
without problems. I'm running it on a live site with 7 ZEO clients.
I've stopped a client (say client 2) so it is not accessed
concurrently and run my script with client2/zopectl. It is in fact a
Plone site but that should be irrelevant.

Thanks for any help
Hedley
___
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] re ad-only-database

2009-03-17 Thread Jean Jordaan

Hi Tres


Tres Seaver wrote:
> 
> Can you please file a bug suggesting changing the '.in' file?
> 

Certainly:
  https://bugs.launchpad.net/zope2/+bug/344098

-- 
View this message in context: 
http://www.nabble.com/read-only-database-tp3438824p22553862.html
Sent from the Zope - General mailing list archive at Nabble.com.

___
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 )