*** aclark has joined #zope | 00:07 | |
*** Arfrever has quit IRC | 00:37 | |
*** aclark has quit IRC | 00:38 | |
*** supton has quit IRC | 00:39 | |
*** encolpe has quit IRC | 00:47 | |
*** supton has joined #zope | 01:39 | |
*** fredvd has joined #zope | 01:50 | |
*** fredvd has quit IRC | 02:11 | |
*** supton has quit IRC | 02:24 | |
*** srichter has joined #zope | 02:29 | |
*** srichter has joined #zope | 02:29 | |
*** srichter_ has quit IRC | 02:33 | |
*** srichter has quit IRC | 02:34 | |
*** aclark has joined #zope | 02:41 | |
*** srichter has joined #zope | 02:42 | |
*** aclark has quit IRC | 02:52 | |
*** alecm has quit IRC | 02:55 | |
*** tiwula has quit IRC | 02:56 | |
*** supton has joined #zope | 03:30 | |
*** supton_ has joined #zope | 03:33 | |
*** supton has quit IRC | 03:35 | |
*** supton_ is now known as supton | 03:35 | |
*** srichter_ has joined #zope | 03:39 | |
*** srichter_ has quit IRC | 03:41 | |
*** srichter_ has joined #zope | 03:41 | |
*** srichter has quit IRC | 03:43 | |
*** supton has quit IRC | 03:52 | |
*** povbot has joined #zope | 06:40 | |
*** Tr1pp3r has joined #zope | 07:23 | |
*** Tr1pp3r has quit IRC | 07:24 | |
*** yvl has joined #zope | 08:18 | |
*** Arfrever has joined #zope | 09:41 | |
*** encolpe has joined #zope | 09:41 | |
*** encolpe_ has joined #zope | 10:33 | |
*** giacomos has joined #zope | 10:35 | |
*** encolpe has quit IRC | 10:37 | |
*** m8 has joined #zope | 10:37 | |
*** fredvd has joined #zope | 10:51 | |
*** aclark has joined #zope | 11:02 | |
*** aclark has quit IRC | 11:36 | |
*** vortec has joined #zope | 11:40 | |
vortec | hi, is this the right place for questions regarding zope 2 still? | 11:40 |
---|---|---|
*** avoinea has quit IRC | 11:41 | |
*** avoinea has joined #zope | 11:41 | |
*** maurits has joined #zope | 11:47 | |
vortec | specifically, i'm trying to automatically mount mountpoints after Zope (2.13.22) has started. for that i'm hooking into the "DatabaseOpenedWithRoot" event (using zope.event) and getting access to the application like this: with ContextManager(db) as conn: app = conn.root()['Application'] | 11:50 |
vortec | after that i run manage_addMounts(app.author, (path,)) but I get different error messages, seems like a race condition, here is the most common one: https://gist.github.com/vortec/86721d4c363734f5bf78 | 11:52 |
MatthewWilkes | vortec: Ah, you're trying to dynamically add a mountpoint at instance start-up? | 11:52 |
vortec | MatthewWilkes: exactly | 11:52 |
MatthewWilkes | Are your mountpoints changing, then? | 11:52 |
vortec | not really. i want to automate the installation mostly | 11:53 |
vortec | i'm installing a lot of zope instances :-) | 11:53 |
MatthewWilkes | vortec: I'd suggest doing it as a console script, rather than listening to events. That way you add them explicitly and are guaranteed it happens after instance start is finished and not in the same process that's potentially serving user requesdts | 11:54 |
MatthewWilkes | vortec: you can do bin/instance run yourscript.py. yourscript.py will then run with 'app' bound into its globals | 11:55 |
vortec | i have "zopectl run", is that the same? | 11:56 |
MatthewWilkes | vortec: Should be, yes. Whatever script you use to start and stop the instance | 11:57 |
MatthewWilkes | vortec: If you're using ZEO or RelStorage for the database backend you can run the script any time, if you're using FileStorage it will only work if the instance isn't running, as only one connection can be open to a filestorage at one time | 11:58 |
vortec | MatthewWilkes: ok i just tried your method and that seems to work fine, thank you! my startup time is really slow, can i go from there to start the ZServer? | 12:03 |
vortec | my goal is to create the zope instance, mount zeos and be ready to serve in 1 step | 12:04 |
vortec | that's why i chose the event approach originally | 12:04 |
vortec | it annoys me a bit that my code works in general but the app object seems to be different in those 2 environments :-) | 12:08 |
MatthewWilkes | vortec: I'm afraid not, the scripts are intended to do maintainence processes, they don't involve setting up the web servers | 12:09 |
MatthewWilkes | vortec: I'd suggest you just run them sequentially in a script. If you've got lots you can do them in parallel without having to supervise them | 12:09 |
MatthewWilkes | the app object is probably different in the event hander situation as it's happening in the context of a multi-threaded webserver startup's process, rather than a maintainence script, so it's worrying about things like threadlocal variables and transaction management rather than treating it as a simple case | 12:11 |
vortec | ahhh | 12:14 |
vortec | its multi-threaded ok. thats explains a lot | 12:15 |
vortec | i guess i will use the script variant then. and make my installer compare the zope.conf, in case something _has_ changed and it needs to mount another ZEO | 12:16 |
vortec | thanks matthew! that was really helpful | 12:16 |
MatthewWilkes | vortec: No worries | 12:17 |
*** encolpe_ has quit IRC | 12:19 | |
vortec | is it safe to pass arguments to zopectl run? + | 12:36 |
vortec | i can just read them via sys.argv? | 12:36 |
moo-_- | vortec: I guess testing out tells it :) | 12:38 |
vortec | true :-) | 12:38 |
moo-_- | I remember the argument handler was quite primitive | 12:39 |
moo-_- | if it doesn't work out use environment variables | 12:39 |
*** maurits has quit IRC | 12:44 | |
*** maurits has joined #zope | 12:50 | |
MatthewWilkes | I think it is safe | 12:51 |
MatthewWilkes | I've done it plenty, anyway | 12:51 |
vortec | yes, looks good | 13:06 |
*** projekt01 has joined #zope | 13:13 | |
*** maurits has quit IRC | 13:56 | |
*** maurits has joined #zope | 13:56 | |
*** avoinea has quit IRC | 13:57 | |
*** avoinea has joined #zope | 13:58 | |
*** encolpe_ has joined #zope | 14:20 | |
*** maurits has quit IRC | 15:00 | |
*** srichter_ has quit IRC | 15:00 | |
*** maurits has joined #zope | 15:14 | |
*** srichter_ has joined #zope | 15:20 | |
*** yvl has quit IRC | 15:42 | |
*** benji has quit IRC | 16:28 | |
*** benji has joined #zope | 16:40 | |
*** projekt01 has quit IRC | 16:53 | |
*** projekt01 has joined #zope | 17:06 | |
*** jakke1 has quit IRC | 17:19 | |
*** projekt01_ has joined #zope | 17:20 | |
*** projekt01 has quit IRC | 17:23 | |
*** fredvd has quit IRC | 17:51 | |
*** srichter has joined #zope | 18:02 | |
*** srichter_ has quit IRC | 18:06 | |
*** srichter has quit IRC | 18:06 | |
*** srichter has joined #zope | 18:07 | |
*** srichter has quit IRC | 18:12 | |
*** srichter has joined #zope | 18:25 | |
*** srichter has quit IRC | 18:28 | |
*** supton has joined #zope | 18:29 | |
*** supton has quit IRC | 18:36 | |
*** srichter has joined #zope | 18:37 | |
*** supton has joined #zope | 18:40 | |
*** aclark has joined #zope | 18:41 | |
*** srichter has quit IRC | 18:44 | |
*** srichter has joined #zope | 18:45 | |
*** projekt01_ has quit IRC | 18:45 | |
*** srichter has quit IRC | 18:48 | |
*** aclark has quit IRC | 18:51 | |
*** srichter has joined #zope | 18:51 | |
*** srichter has quit IRC | 18:54 | |
*** srichter has joined #zope | 18:55 | |
*** srichter has quit IRC | 18:58 | |
*** srichter has joined #zope | 19:05 | |
*** srichter has quit IRC | 19:08 | |
*** srichter has joined #zope | 19:09 | |
*** srichter has quit IRC | 19:12 | |
*** srichter has joined #zope | 19:13 | |
*** srichter has quit IRC | 19:16 | |
*** srichter has joined #zope | 19:23 | |
*** srichter has quit IRC | 19:32 | |
*** srichter has joined #zope | 19:37 | |
*** alecm has joined #zope | 19:37 | |
*** srichter has quit IRC | 19:40 | |
*** maurits has quit IRC | 19:46 | |
*** srichter has joined #zope | 19:53 | |
*** srichter has quit IRC | 19:58 | |
*** srichter has joined #zope | 20:09 | |
*** maurits has joined #zope | 20:11 | |
*** srichter has quit IRC | 20:12 | |
*** srichter has joined #zope | 20:15 | |
*** srichter has quit IRC | 20:18 | |
*** srichter has joined #zope | 20:23 | |
*** vortec has quit IRC | 20:24 | |
*** srichter has quit IRC | 20:28 | |
*** aclark has joined #zope | 20:30 | |
*** m8 has quit IRC | 20:33 | |
*** srichter has joined #zope | 20:41 | |
*** supton has quit IRC | 20:51 | |
*** aclark has quit IRC | 20:59 | |
*** aclark has joined #zope | 20:59 | |
*** alecm has quit IRC | 21:04 | |
*** alecm has joined #zope | 21:11 | |
*** aclark has quit IRC | 21:34 | |
*** supton has joined #zope | 22:13 | |
*** supton has quit IRC | 22:21 | |
*** supton has joined #zope | 22:23 | |
*** supton has quit IRC | 22:41 | |
*** supton has joined #zope | 22:42 | |
*** srichter has quit IRC | 23:21 | |
*** alecm has quit IRC | 23:28 | |
*** supton has quit IRC | 23:32 | |
*** alecm has joined #zope | 23:57 | |
*** alecm has joined #zope | 23:57 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!