IRC log of #zope for Friday, 2016-01-08

*** aclark has joined #zope00:07
*** Arfrever has quit IRC00:37
*** aclark has quit IRC00:38
*** supton has quit IRC00:39
*** encolpe has quit IRC00:47
*** supton has joined #zope01:39
*** fredvd has joined #zope01:50
*** fredvd has quit IRC02:11
*** supton has quit IRC02:24
*** srichter has joined #zope02:29
*** srichter has joined #zope02:29
*** srichter_ has quit IRC02:33
*** srichter has quit IRC02:34
*** aclark has joined #zope02:41
*** srichter has joined #zope02:42
*** aclark has quit IRC02:52
*** alecm has quit IRC02:55
*** tiwula has quit IRC02:56
*** supton has joined #zope03:30
*** supton_ has joined #zope03:33
*** supton has quit IRC03:35
*** supton_ is now known as supton03:35
*** srichter_ has joined #zope03:39
*** srichter_ has quit IRC03:41
*** srichter_ has joined #zope03:41
*** srichter has quit IRC03:43
*** supton has quit IRC03:52
*** povbot has joined #zope06:40
*** Tr1pp3r has joined #zope07:23
*** Tr1pp3r has quit IRC07:24
*** yvl has joined #zope08:18
*** Arfrever has joined #zope09:41
*** encolpe has joined #zope09:41
*** encolpe_ has joined #zope10:33
*** giacomos has joined #zope10:35
*** encolpe has quit IRC10:37
*** m8 has joined #zope10:37
*** fredvd has joined #zope10:51
*** aclark has joined #zope11:02
*** aclark has quit IRC11:36
*** vortec has joined #zope11:40
vortechi, is this the right place for questions regarding zope 2 still?11:40
*** avoinea has quit IRC11:41
*** avoinea has joined #zope11:41
*** maurits has joined #zope11:47
vortecspecifically, 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
vortecafter 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/86721d4c363734f5bf7811:52
MatthewWilkesvortec: Ah, you're trying to dynamically add a mountpoint at instance start-up?11:52
vortecMatthewWilkes: exactly11:52
MatthewWilkesAre your mountpoints changing, then?11:52
vortecnot really. i want to automate the installation mostly11:53
vorteci'm installing a lot of zope instances :-)11:53
MatthewWilkesvortec: 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 requesdts11:54
MatthewWilkesvortec: you can do bin/instance run yourscript.py. yourscript.py will then run with 'app' bound into its globals11:55
vorteci have "zopectl run", is that the same?11:56
MatthewWilkesvortec: Should be, yes. Whatever script you use to start and stop the instance11:57
MatthewWilkesvortec: 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 time11:58
vortecMatthewWilkes: 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
vortecmy goal is to create the zope instance, mount zeos and be ready to serve in 1 step12:04
vortecthat's why i chose the event approach originally12:04
vortecit annoys me a bit that my code works in general but the app object seems to be different in those 2 environments :-)12:08
MatthewWilkesvortec: I'm afraid not, the scripts are intended to do maintainence processes, they don't involve setting up the web servers12:09
MatthewWilkesvortec: 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 them12:09
MatthewWilkesthe 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 case12:11
vortecahhh12:14
vortecits multi-threaded ok. thats explains a lot12:15
vorteci 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 ZEO12:16
vortecthanks matthew! that was really helpful12:16
MatthewWilkesvortec: No worries12:17
*** encolpe_ has quit IRC12:19
vortecis it safe to pass arguments to zopectl run? +12:36
vorteci can just read them via sys.argv?12:36
moo-_-vortec: I guess testing out tells it :)12:38
vortectrue :-)12:38
moo-_-I remember the argument handler was quite primitive12:39
moo-_-if it doesn't work out use environment variables12:39
*** maurits has quit IRC12:44
*** maurits has joined #zope12:50
MatthewWilkesI think it is safe12:51
MatthewWilkesI've done it plenty, anyway12:51
vortecyes, looks good13:06
*** projekt01 has joined #zope13:13
*** maurits has quit IRC13:56
*** maurits has joined #zope13:56
*** avoinea has quit IRC13:57
*** avoinea has joined #zope13:58
*** encolpe_ has joined #zope14:20
*** maurits has quit IRC15:00
*** srichter_ has quit IRC15:00
*** maurits has joined #zope15:14
*** srichter_ has joined #zope15:20
*** yvl has quit IRC15:42
*** benji has quit IRC16:28
*** benji has joined #zope16:40
*** projekt01 has quit IRC16:53
*** projekt01 has joined #zope17:06
*** jakke1 has quit IRC17:19
*** projekt01_ has joined #zope17:20
*** projekt01 has quit IRC17:23
*** fredvd has quit IRC17:51
*** srichter has joined #zope18:02
*** srichter_ has quit IRC18:06
*** srichter has quit IRC18:06
*** srichter has joined #zope18:07
*** srichter has quit IRC18:12
*** srichter has joined #zope18:25
*** srichter has quit IRC18:28
*** supton has joined #zope18:29
*** supton has quit IRC18:36
*** srichter has joined #zope18:37
*** supton has joined #zope18:40
*** aclark has joined #zope18:41
*** srichter has quit IRC18:44
*** srichter has joined #zope18:45
*** projekt01_ has quit IRC18:45
*** srichter has quit IRC18:48
*** aclark has quit IRC18:51
*** srichter has joined #zope18:51
*** srichter has quit IRC18:54
*** srichter has joined #zope18:55
*** srichter has quit IRC18:58
*** srichter has joined #zope19:05
*** srichter has quit IRC19:08
*** srichter has joined #zope19:09
*** srichter has quit IRC19:12
*** srichter has joined #zope19:13
*** srichter has quit IRC19:16
*** srichter has joined #zope19:23
*** srichter has quit IRC19:32
*** srichter has joined #zope19:37
*** alecm has joined #zope19:37
*** srichter has quit IRC19:40
*** maurits has quit IRC19:46
*** srichter has joined #zope19:53
*** srichter has quit IRC19:58
*** srichter has joined #zope20:09
*** maurits has joined #zope20:11
*** srichter has quit IRC20:12
*** srichter has joined #zope20:15
*** srichter has quit IRC20:18
*** srichter has joined #zope20:23
*** vortec has quit IRC20:24
*** srichter has quit IRC20:28
*** aclark has joined #zope20:30
*** m8 has quit IRC20:33
*** srichter has joined #zope20:41
*** supton has quit IRC20:51
*** aclark has quit IRC20:59
*** aclark has joined #zope20:59
*** alecm has quit IRC21:04
*** alecm has joined #zope21:11
*** aclark has quit IRC21:34
*** supton has joined #zope22:13
*** supton has quit IRC22:21
*** supton has joined #zope22:23
*** supton has quit IRC22:41
*** supton has joined #zope22:42
*** srichter has quit IRC23:21
*** alecm has quit IRC23:28
*** supton has quit IRC23:32
*** alecm has joined #zope23:57
*** alecm has joined #zope23:57

Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!