Camelia, the Perl 6 bug

IRC log for #mojo, 2012-07-05

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:06 GitHub93 joined #mojo
00:06 GitHub93 [mojo] kraih pushed 1 new commit to master: http://git.io/_1Za7Q
00:06 GitHub93 [mojo/master] pass exception object to around_exception hook - Sebastian Riedel
00:06 GitHub93 left #mojo
00:13 dog_chocolate joined #mojo
00:51 bird joined #mojo
01:00 scott_ joined #mojo
01:04 laouji joined #mojo
01:18 batman joined #mojo
01:55 d4rkie joined #mojo
02:12 noganex_ joined #mojo
03:25 Debolaz[Lo] joined #mojo
03:28 dog_chocolate joined #mojo
05:08 amirite joined #mojo
05:17 rem_lex|pivo joined #mojo
05:19 amirite is there a way to detect when my app code changes so i can tell hypnotoad to upgrade
05:20 crab isn't that backwards? whenever you change your code, signal hypnotoad
05:21 amirite i'm silly and like to run hypnotoad in development
05:21 crab so write something with inotify that signals hypnotoad
05:22 amirite whats inotify?
05:22 amirite code change detection?
05:22 crab filesystem notifications
05:22 amirite ok
05:22 amirite thanks crab
05:22 amirite you++
05:23 crab depending on what os you use, the fs notification mechanism may be called something different
05:23 crab also note that at least on linux, there are inotify cli utilities that you can use in a hacked-up shell script
05:25 amirite right, that's what i use and that's what i do--i've got all sorts of nifty hacked-up shell scripts for managing app/server/schema start/stop/restart/upgrade sitting in ./script
05:25 crab or you can use morbo and hack it up to do nothing but signal hypnotoad
05:26 spleenjack joined #mojo
05:26 amirite i don't know the pros/cons of morbo vs hypnotoad
05:26 amirite so i'll just stick with hypnotoad
05:27 crab morbo is a single process that detects changes to your code and restarts the app. otherwise it's the same as hypnotoad internally.
05:31 Leandr joined #mojo
05:38 daxim joined #mojo
05:39 laouji joined #mojo
05:46 vishwanathms joined #mojo
05:46 vishwanathms_ joined #mojo
05:49 ynon joined #mojo
05:51 Debolaz[Lo] joined #mojo
05:58 crab using hypnotoad and doing extra work to make it restart is just silly
06:02 ovnimancer joined #mojo
06:20 xaka joined #mojo
06:27 Vandal joined #mojo
06:52 fhelmber_ joined #mojo
06:52 Andrei666 joined #mojo
06:52 lukep joined #mojo
06:53 dog_chocolate joined #mojo
06:59 crab chocolate is poisonous to dogs.
07:00 alnewkirk so is antifreeze
07:00 xaka1 joined #mojo
07:09 bc547 crab: and cats die when you give them aspirine
07:14 * sri yawns
07:16 crab bc547: really? that sucks.
07:18 bc547 crab: they miss the glucuronide conjugates that aid in breaking down acetylsalicylic acid (aspirin)
07:21 crab so it's like eating dilute sulphuric acid? or is it something else that makes the unbroken-down acetylsalicyclic acid kill them?
07:24 sri tempire, marcus, crab: what are your thoughts on around_exception and around_not_found?
07:25 sri https://github.com/kraih/mojo/blo​b/master/lib/Mojolicious.pm#L578
07:26 crab marcrabpire
07:28 crab i don't know yet
07:31 sri an exception hook is very useful, for services like airbreak alone, the real question is if it should be a hook chain and what do to about around_not_found, which is less useful
07:31 sri s/airbreak/airbrake/
07:31 crab yes, i agree that the exception hook is something i could've used in te past.
07:32 sri https://airbrake.io
07:32 bc547 crab: http://voices.yahoo.com/side-effect​s-aspirin-cats-2801928.html?cat=70 4th paragraph (Aspirin induces...)
07:40 marcus judofyr already did an airbrake integration for mojolicious.
07:41 Leandr joined #mojo
07:41 sri suppose he used an after_dispatch hook and grabbed the exception that was still in the stash
07:43 sri right, that case is even tested, i remember
07:43 sri hmm
07:45 sri guess that's a good argument against having those hooks
07:46 pau4o joined #mojo
07:48 sri marcus: you sank my battleship
07:48 marcus \o/
07:49 marcus now finish your mongodb driver instead ;-)
07:49 sri mkay
07:59 taryk joined #mojo
08:02 GitHub192 joined #mojo
08:02 GitHub192 [mojo] kraih pushed 1 new commit to master: http://git.io/507WcA
08:02 GitHub192 [mojo/master] removed around_exception and around_not_found hooks again - Sebastian Riedel
08:02 GitHub192 left #mojo
08:03 lukep joined #mojo
08:03 tempire I like the around_exception and around_not_found because it's more apparent than after_dispatch
08:04 tempire marcus: where is that airbrake integration?
08:04 crab more "apparent"? huh?
08:07 marcus tempire: guess he didn't publish it, here, I've no pasted it : http://pastie.org/4203116
08:11 vishwanathms joined #mojo
08:11 vishwanathms_ joined #mojo
08:14 jontaylor joined #mojo
08:15 GitHub124 joined #mojo
08:15 GitHub124 [mojo] kraih pushed 1 new commit to master: http://git.io/xecmmw
08:15 GitHub124 [mojo/master] added exception monitoring recipe - Sebastian Riedel
08:15 GitHub124 left #mojo
08:15 sri better just document how it works now
08:15 sri it's not so bad
08:17 tempire that's fine too
08:17 JiYu joined #mojo
08:33 batman joined #mojo
08:36 andrefs joined #mojo
08:44 jontaylor I want to create my first mojolicious plugin, my idea is to modify bridges to work more like rails before_filter and after_filter on the controllers
08:44 jontaylor but I need to do it after its routed, so that I have access to the controller object
08:44 jontaylor I imagine I might be best off using a hook to do this
08:57 diegok jontaylor: you mean "more like rails filters" as they are defined on your controller instead of router or what you mean?
08:57 jontaylor yes diegok
08:58 jontaylor just to run some code before and after the action is called, but still in the namespace of the controller
08:58 jontaylor and defined within the controller
09:01 amirite hmm
09:01 amirite i was going to ask something important but i forgot what it was
09:01 diegok jontaylor: not pretty sure, but the problem I see is controllers are loaded after the router. After that, I think you can "detach" the route and insert it after an on the fly bridge you can create...
09:02 jontaylor diegok: right not i'm looking in Mojolicious::Routes and I think the controller is first loaded in the _controller method
09:02 jontaylor *right now
09:07 diegok jontaylor: at controller level you can probably use something more perlish like https://metacpan.org/modul​e/Class::Method::Modifiers :-/
09:22 sri or just Moose
09:24 sri before filters re pretty easy on the routes layer, with bridges
09:24 jontaylor diegok: thats a good idea!
09:24 sri but after filter don't fit in very well there
09:25 jontaylor sri: I've had a bash at that, I've got something that kind of works
09:25 jontaylor but I have to instantiate the controller myself
09:25 jontaylor I could be mistaken, but this is what i've found from an hour of looking around
09:25 jontaylor keep in mind i've not used mojo before so I could be getting it wrong
09:26 jontaylor but I actually really like that Mojo doesn't have some things built in and you add it all as plugins
09:26 jontaylor far better than a big monolithic thing like rails
09:32 andrefs joined #mojo
09:35 Leandr joined #mojo
09:52 amirite jontaylor i bet you tweet a lot
09:55 jontaylor i've made 498 tweets over the last 3 years
09:56 jontaylor I don't know if that counts as a lot or not
10:19 Psyche^ joined #mojo
10:37 Foxcool joined #mojo
10:41 mire joined #mojo
10:45 sri \o\
10:45 sri /o/
10:58 marcus sri, when I try ab on my app, I get [Thu Jul  5 12:57:28 2012] [error] Can't call method "res" on an undefined value at /Users/marcus/perl5/perlbrew/perls/perl-5.14.1/​lib/site_perl/5.14.1/Mojolicious/Controller.pm line 346.
10:58 marcus why wouldn't a request have a transaction?
11:07 sri weakened and cleaned up?
11:09 marcus might be, this is using the redis driver. How do I avoid that?
11:13 marcus sri: never mind, I got it.
11:14 marcus now I get another interesting error :)
11:15 sri booooooooring
11:15 marcus "Can't use global $0 in "my" at inline template line 1, near "<html>"."
11:15 marcus sri: I was using parallel and needed weaken=>0 since I didn't refer to self :)
11:16 marcus but the global $0 I really don't get
11:17 Htbaa joined #mojo
11:22 marcus hmm no, still in trouble :(
11:22 sri troublemaker
11:22 marcus it works fine in the browser, but ab just kills the whole site.
11:23 marcus fucking memory management is hard :-/
11:23 sri when you go async the training wheels are off
11:24 marcus yepp
11:24 sri yea, i still wish we could just remove that damn weaken call
11:24 sri https://github.com/kraih/mojo/blo​b/master/lib/Mojolicious.pm#L155
11:25 sri but without it the errors wouldn't be as upfront, just lots of leakage and untraceable crashes
11:28 sri hmmm
11:28 n joined #mojo
11:28 n hello
11:28 sri we don't actually have any tests that depend on the weaken call anymore
11:29 n it's the weaken already ? great !
11:29 nicolasbd is "$r->websocket('/chat')->to(cont​roller=>'Chat',action=>'chat');" the good way to make a route for a chat ?
11:30 nicolasbd (where "my $r = $self->routes;" )
11:33 marcus sri: I suspect that weaken call is what gets me.
11:34 sri marcus: most likely, you're welcome to look for alternative solutions, but i doubt there are any
11:37 marcus sri: nom, I commented out those two weaken calls, and I set weaken=0 to Parallol, but I still get those errors.
11:37 crab nicolasbd: sure, or just ->to('chat#chat')
11:38 sri chat chat chat
11:38 sri marcus: Oo
11:38 nicolasbd sri: ok thanks, wasn't sure for the $r->websocket
11:39 sri i'm almost certain i wasn't helpful
11:39 sri you mean crab
11:39 nicolasbd or if I should do something with  $ws=Websocket->new
11:41 marcus sri: actually commenting out weaken  removes the error message, it just still returns a 400 bad request.
11:41 marcus not sure wtf ab is doing to mojolicious
11:43 sri ab likes closing connections too early
11:43 marcus yeah, I see it likes http 1.0 too
11:44 sri marcus: if you find a way to remove the weaken without making all these tests leak you'd be my hero https://github.com/kraih/mojo/blob/mast​er/t/mojolicious/longpolling_lite_app.t
11:46 marcus sri: seems to be working allirght with siege, fuck ab I guess.
11:46 sri ab -k better?
11:47 marcus avg 0.03 per request
11:47 marcus redis fuck yeah
11:48 marcus
11:48 marcus sri: yeah, ab -k seems to be working
11:49 marcus actually, it crashes occasionally too, but much less often.
11:50 marcus guess I shouldn't worry too much about it.
11:50 sri you're not using the default one on osx are you?
11:50 marcus yea?
11:50 sri lulx
11:50 marcus 'sbroken?
11:50 sri that one is completely busted
11:51 sri some kqueue bug
11:51 sri you need to build your own from the latest apache dev version
11:51 marcus guess I'll just use siege
11:53 sri marcus: http://mojolicio.us/ab # put that one in /usr/local/bin
11:54 marcus sri: that one works like a charm
11:54 sri :)
11:56 marcus 357 rps on a dynamic request with 3 redis queries :)
11:56 marcus and a template
11:56 marcus with -n 1000 -c 10
11:56 sri moar concurrency
11:57 marcus 435 with -c 30
12:00 marcus wtf lol, 1250 fps with -c 100
12:00 marcus rps
12:01 crab that's linear-ish scaling up.
12:01 marcus seems to crash after around 5000 requests tho
12:01 marcus [Thu Jul  5 14:01:30 2012] [info] Worker 78884 has no heartbeat, restarting.
12:01 sri not surprising
12:02 crab why not surprising?
12:02 sri don't forget the osx descriptor limit
12:02 crab oh.
12:03 sri heavy ab tests are often very inconsistent, because osx waits a few seconds before releasing a free descriptor again for reuse and stuff like that
12:03 marcus upped the fd limit, still crashes
12:04 marcus seems the children just get unresponsive, I don't get anything else in the log.
12:04 sri sounds like a blocking connect by the redis client or so
12:05 sri (which i guess could be because of a descriptor limit)
12:05 * sri is just guessing though
12:06 sri or if you still have the weaken commented out you might leak
12:06 marcus no, I readded weaken,
12:07 marcus seems after it loses the heartbeat and gets restarted, it exhibits the losing tx behavior again.
12:07 sri which just means the connection was lost while your events are still active
12:08 marcus yepp
12:08 marcus should I be checking for that in the callback?
12:08 marcus return unless $self->tx ?
12:08 sri many ways to handle that
12:08 sri or my $tx = $self->tx before the callback
12:08 sri (increse ref count)
12:12 marcus hmm, seems it's probably hitting the accept limit
12:12 marcus then failing to stop gracefully
12:15 sri no heartbeat is more serious
12:16 sri it means the event loop has been blocked for more than 20 seconds
12:16 marcus yepp, confirmed
12:17 marcus if I set accept => 0 it works
12:17 marcus sri: seems it gets blocked while trying to stop gracefully
12:17 sri Oo
12:17 marcus just served 20000 requests without fail
12:18 marcus but with accepts in the default setting, it fails.
12:18 jnap joined #mojo
12:18 pau4o joined #mojo
12:19 sri marcus: is there a way for me to replicate it?
12:19 marcus it's strange, because I can kill the server fine with -c
12:19 marcus sri: I'll try to create something.
12:21 sri if there are connections that refuse to stop i would expect a forced stop of the worker, not a heartbeat timeout
12:23 andrefs joined #mojo
12:31 marcus sri: https://gist.github.com/3053439
12:31 marcus sri: needs https://github.com/marcusramberg/mojo-redis
12:31 sri and a redis server
12:31 sri is there something more generic?
12:32 marcus hmm, dunno
12:35 sri can't you make http requests to google or so?
12:36 marcus I'll try, btw, the timer example in Mojo::IOLoop pod seems incomplete. Where do you get $id from?
12:36 sri ?
12:39 marcus sri: in the synopsis?
12:39 sri look a few lines above the timer
12:39 marcus oh
12:40 marcus wasn't able to reproduce it with a timer btw :)
12:40 sri could be something about client connections then
12:41 marcus couldn't reproduce it with ->ua either
12:41 sri maybe with ->client
12:43 marcus trying
12:43 sri sorry, but i'm not gonna track it down with redis, that's way too many variables
12:46 marcus yepp, understandable.
12:46 marcus with client it is.
12:47 marcus https://gist.github.com/3053496
12:47 marcus (libev) select: Invalid argument
12:49 spleenjack left #mojo
12:50 sri marcus: can't confirm, works fine here i'm afraid
12:50 marcus sri: no failed requests?
12:50 marcus sri: do you have libev?
12:51 sri none, and yes
12:51 marcus awesome
12:51 sri 326.85 [#/sec] (mean)
12:51 marcus how do I disable ab again?
12:51 marcus ev even
12:51 sri Failed requests:        0
12:51 sri MOJO_REACTOR=Mojo::Reactor::Poll
12:52 sri with EV 4.11
12:52 sri latest IO::Socket::IP and IO::Socket::SSL too
12:53 marcus sri: how many requests do you test?
12:53 marcus even without Reactor::EV it hangs here around 4000 requests for a while
12:53 sri ab -c 100 -n 10000 http://127.0.0.1:8080/
12:54 marcus hmm, actually, I didn't get failed requests either without ev
12:54 sri hmm
12:54 sri with and without EV is fine here
12:55 marcus hmm, guess I'm bombing vg.no quite a bit with this
12:55 sri well, EV unit tests are pretty miserable (just like AnyEvent), so you never know what you get
12:55 marcus making 10000 connects as fast as I can...
12:56 sri our unit tests are IO::Poll only too by default
12:56 * sri shrugs
12:57 marcus mm
12:58 sri (not like it would make any difference... i wouldn't dare send failing tests to mlehmann)
13:04 marcus I think the fails I saw were just false positives from network.
13:04 marcus the ->client test ran fine for me now. And it still fails with Mojo::Redis. Guess I need to keep digging.
13:04 marcus even fails with the poll reactor
13:04 mire joined #mojo
13:05 nicolasbd when doing "$r->websocket('/chat')->to(cont​roller=>'Chat',action=>'chat');" ,  should my "Chat" controller use some Websocket class ? nor is it a simple Controller ?
13:05 nicolasbd it works well .. till the connection is closed for (or by?) a client : then, it freezes
13:05 nicolasbd no idea how to deal with this ..
13:05 sri marcus: maybe you can track it down yourself :)
13:06 marcus sri: well, finding what actually makes it fail seems like the hardest part :)
13:06 sri marcus: which is a little strange, the accept limit doesn't affect much code
13:07 sri maybe you can track down where exactly the event loop gets blocked with lots and lots of warn() calls ;p
13:09 sri Go is a pretty cool language btw
13:09 sri if only it wasn't so tied to google
13:09 * whee awaits mogolicious
13:09 sri Gojolicious
13:10 whee Frank.
13:10 nicolasbd mogolicious is nice
13:12 gryphon joined #mojo
13:14 Foxcool joined #mojo
13:16 andrefs joined #mojo
13:16 jontaylor I've got this in one of my templates
13:16 jontaylor %= include '/shared/nav'
13:17 jontaylor but its doing absolutely nothing, I can change the template to something I know doesn't exist and it does the same
13:17 jontaylor is there some way I can force it to raise an error, because i'm sure i'm using it wrong but i'm getting nothing out
13:19 bjoernfan What are your thoughts on Mojolicious::Plugin::Database?
13:19 crab /shared/nav? Shouldn't it be just shared/nav?
13:21 jontaylor crab: i'll give that a try
13:21 jontaylor still nothing :(
13:22 crab where does the template live?
13:22 jontaylor templates/shared/nav.html.ep
13:24 jontaylor is it because i'm calling a partial from within the layout?
13:26 nicolasbd why does the websocket closes the communication itself, and what should i do to remain it ?
13:37 nicolasbd i should ask the CERN
13:39 d4rkie joined #mojo
13:40 CromeDome joined #mojo
14:06 sri marcus: i just stumbled over something
14:07 sri https://github.com/kraih/mojo/blob/mas​ter/lib/Mojo/Server/Hypnotoad.pm#L328
14:07 sri that line prevents the heartbeat, and i have no idea why it exists
14:08 sri oh, it might actually make sense
14:10 nic jontaylor: Including partial in a layout is working here: <%== include 'header' %>
14:10 sri when a worker reaches the accept limit it sets max_connections to 0, which prevents new connections from being accepted and makes the worker stop gracefully once all connections are closed
14:10 jontaylor nic: yeah it was me being stupid, I had put the file extension as .erb
14:11 nic ah, cool
14:11 sri but the manager process doesn't know about that, so preventing heartbeats serves as a timeout for the graceful shutdown
14:12 nic that would be the 'embedded really badly' template language
14:18 Leandr joined #mojo
14:19 sri marcus: yea, i'm afraid the current behavior makes perfect sense
14:20 marcus sri: guess that my problem then is that redis is doing a 300 second timeout on it's connection
14:20 marcus sri: and not disconnecting
14:20 sri yes
14:21 sri i'm not sure how to handle it better
14:21 marcus sri: is there a way for me to disconnect on restart?
14:21 marcus like, can I detect that hypnotoad is doing a graceful restart and close?
14:21 sri you could check Mojo::IOLoop->singleton->max_connections == 0
14:22 sri but i don't think that's the right way
14:26 marcus what is the right way?
14:28 migo joined #mojo
14:31 sri marcus: you tell me
14:33 sri how do you correctly perform a worker scoped graceful shutdown with client connections you know nothing about
14:44 sri marcus: what's the actual error you get?
15:11 asarch joined #mojo
15:18 jamadam joined #mojo
15:22 joelberger joined #mojo
15:24 joelberger hi #mojo
15:24 joelberger I have a question, and it might stem from my trying a silly thing
15:25 joelberger is it possible to update the session cookie from inside a websocket's "on message" callback?
15:25 joelberger it doesn't seem like it is
15:25 joelberger I'm trying to make a websocket-only no-refresh login thingy
15:26 joelberger but it seems I might be up against the limitations of the websocket/cookie architecture
15:27 joelberger the other way to do this might be to store the credential not in the cookie, but in a sessionStorage on the client side, but I don't know how to use that from the "under" directive
15:31 gryphon joined #mojo
15:32 GitHub15 joined #mojo
15:32 GitHub15 [mojo] kraih pushed 1 new commit to master: http://git.io/fjsh4g
15:32 GitHub15 [mojo/master] improved Hypnotoad log messages a little - Sebastian Riedel
15:32 GitHub15 left #mojo
15:32 sri marcus: for now i'll just document the current behavior better
15:34 sri but a timeout of heartbeat_timeout + graceful_timeout seems very sensible to me for workers that want to restart themselves
15:35 sri once you have connections with very long idle timeouts there is not much you can do to close them gracefully
15:36 sri since we have no idea what they do, for all we know it could be a non-blocking db query that just takes a very long time
15:38 sri not restarting automatically at all is sadly not a very good option with Perl... since some module always leaks :S
15:48 alester joined #mojo
15:53 baton8 joined #mojo
15:55 bporter joined #mojo
15:55 bporter heya
15:55 bporter so I'm trying to eval something in a template, to test existance of a variable within the stash, and I'm having a helluva time getting it to work
15:56 bporter % if ( eval { defined $services  && $#{ $services } > 0 } && !$@ ) {
15:56 bporter if 'services' is defined within the stash, there are no problems, but if not, it causes an internal exception
15:57 bporter only reason I wrapped it within an eval is to see if that would trap it from throwing the internal exception if it wasn't defined... to no avail
16:00 bporter any ideas?
16:00 bporter Global symbol "$services" requires explicit package name at template "content.html.ep" line 64
16:04 jamadam joined #mojo
16:05 Ulti bporter oddly I ran into this just yesterday
16:05 Ulti you need to just define your own 'local $SIG{__DIE__} = sub {};' just before your eval
16:11 mire joined #mojo
16:11 bporter ok cool, thanks
16:19 pau4o left #mojo
16:19 nic bporter: Maybe I haven't had enough coffee, but doesn't this do what you want "% if ($services and @$services) {"
16:19 nic or do you really want to check for there being at least two?
16:20 vel joined #mojo
16:24 nic oh I see, I'd need "% if (stash->('services') and @{stash->('services')}) {" if I don't ensure $services is declared
16:24 amirite how do i automagically route '/:controller/:action/:stuff' again ?
16:24 * amirite checks docs
16:26 GitHub120 joined #mojo
16:26 GitHub120 [mojo] kraih pushed 1 new commit to master: http://git.io/mBSs2g
16:26 GitHub120 [mojo/master] documentation tweaks - Sebastian Riedel
16:26 GitHub120 left #mojo
16:26 amirite can't find it
16:31 crab $r->route('/:controller/:action/:stuff
16:31 crab ');
16:59 CromeDome joined #mojo
17:01 sh9 joined #mojo
17:07 amirite how come routes isn't routing underscores in action names
17:07 amirite that's foo
17:09 batman joined #mojo
17:25 noganex joined #mojo
17:31 bporter Ulti: that did not fix the issue
17:31 bporter % if ( eval { local $SIG{__DIE__} = sub {}; defined $services } ) {
17:32 bporter still throws an internal exception when 'services' doesn't exist in the stash
17:36 bporter any ideas?
17:37 bporter nic: so I access any other stash key directly by $keyname, but you're saying I need to check for existance based on stash->('keyname') ?
17:41 bporter no dice
17:41 bporter % if ( eval { local $SIG{__DIE__} = sub {}; defined stash->( 'services' ) } && not $@ ) {
17:42 bporter doesn't complain on that line, but within that if { } block, when I go to use $services, it throws an exception again
17:42 bporter should not be entering the if {} block, since services is not defined in the stash
17:44 crab bporter: just do: if stash('blah') { ...use $blah here... }
17:45 crab stash->('services') looks very wrong to me. where did you get that?
17:48 crab you should probably arrange to have $blah always set.
17:48 crab so that you can then just do "if (@$blah)" in your template. but if you can't/don't want to do that, the if (stash('blah')) test should work.
17:50 ppriess joined #mojo
17:53 bporter 12:24 < nic> oh I see, I'd need "% if (stash->('services') and @{stash->('services')}) {" if I don't ensure $services is declared
17:53 bporter ok cool
17:53 bporter do I need to wrap that in an eval and trap SIGDIE's? heh
17:56 bporter same thing
17:56 bporter Global symbol "$services" requires explicit package name at template "content.html.ep"
17:56 bporter (restarted morbo, just to make sure the template got cleared out of the cache)
17:57 bporter % if ( stash( services ) ) {
17:57 bporter ah, you're telling me to quote services... didn't see that... my bad
17:58 crab you do not need to wrap that in an eval and trap __DIE__.
18:01 bporter still fails when I single-quote services
18:01 bporter (with or without quotes)
18:04 bporter I think Mojo hates me today :(
18:05 bporter ah, CPAN says there's a Mojolicuous upgrade available, installing now (doubt it will help, but can't hurt!)
18:07 bporter yeah no change
18:08 bporter hmm maybe I should just make it always defined in the stash then, and just check to see if there are more than 0 items in the array
18:08 bporter less hassle I suppose
18:10 marcus sri: Probably we should provide a on_shutdown hook or similar? So the app can disconnect the redis connection and not stall the shutdown?
18:11 sri marcus: got an example?
18:13 marcus app->hook(on_shutdown => sub { $redis->disconnect() });
18:14 ppriess left #mojo
18:14 sri there is no connection between app and server
18:14 marcus or maybe before_shutdown would be more sensible
18:14 marcus the server can call things on the app tho, can't it?
18:14 vishwanathms joined #mojo
18:14 vishwanathms_ joined #mojo
18:16 sri sounds messy
18:20 marcus maybe
18:22 marcus I don't have any better ideas tho
18:22 marcus guess that means you shouldn't maintain a persistent connection using mojo::ioloop
18:23 sri marcus: i don't really see the problem though
18:24 sri there's at least 50 seconds in which no connections are accepted
18:24 marcus sri: doesn't that mean that the app is stalling?
18:25 sri only if all workers restart at the same time
18:25 marcus in my testing that seems to be the case
18:25 sri an artifical case
18:25 marcus after ~ 4000 requests
18:26 sri well, i'm ok with how it works now, but you're welcome to make a better proposal
18:29 marcus mkay. I think I will just reduce the idle timeout and hope you're right about this being an artificial case. 300 seems like an insane default.
18:42 andrefs joined #mojo
18:43 sri marcus: i have no idea what you're talking about i'm afraid
18:43 marcus sri: that's fine
18:44 sri there is no such thing as an idle timeout, and nothing defaults to 300
18:48 sri marcus: re your shutdown event, doesn't that clash with the idea of a graceful shutdown?
18:48 sri if you drop all connections as soon as a graceful shutdown starts how are you going to finish requests that are still in progress?
18:54 sri async is hard :)
18:54 sri still amazes me how well hypnotoad actually works considering all the complexities
18:59 mire joined #mojo
19:01 jamadam joined #mojo
19:56 peter joined #mojo
19:58 peter joined #mojo
20:01 peter left #mojo
20:07 ZadYree joined #mojo
20:08 ZadYree Hey & All hail to the Hypnotoad!
20:09 marty all-glory-to-the-hypnotoad
20:10 dog_chocolate joined #mojo
20:20 inokenty joined #mojo
20:33 sri ALL GLORY TO THE HYPNOTOAD!
20:36 Foxcool joined #mojo
20:49 andrefs joined #mojo
21:26 mire joined #mojo
21:43 GitHub199 joined #mojo
21:43 GitHub199 [mojo] kraih pushed 1 new commit to master: http://git.io/PDqAww
21:43 GitHub199 [mojo/master] fixed small bug in Test::Mojo - Sebastian Riedel
21:43 GitHub199 left #mojo
21:45 lukep joined #mojo
22:09 andrefs joined #mojo
22:16 jnap_ joined #mojo
22:29 andrefs joined #mojo
22:50 jontaylor_ joined #mojo
22:52 * tempire twitches
23:07 sri marcus: if stalling is the only problem we could also just randomize part of the accept limit
23:18 GitHub47 joined #mojo
23:18 GitHub47 [mojo] kraih pushed 1 new commit to master: http://git.io/CijqoA
23:18 GitHub47 [mojo/master] improved load balancing between Hypnotoad worker processes - Sebastian Riedel
23:18 GitHub47 left #mojo
23:19 sri lets try that
23:19 sri half of the accept limit is now random
23:20 Akron joined #mojo
23:22 Liam`` joined #mojo
23:27 Akron Does that mean: Workers won't die simultaneously when the work they do takes the samer time?
23:30 sri Akron: yes
23:34 Akron sri: Oh - now I know what you meant with "artificial" test cases. It's good to keep that in mind.
23:36 Akron Btw. I really like the changes of first and grep and the introduction of pluck! It's nice to see no slowdown since 3.0!
23:37 Akron (and 3.0 only broke one thing for me - the symbols -> placeholders renaming in the routes patterns.) sri++
23:37 sri \o/
23:37 sri good old symbols
23:39 Akron However, I did something like $placeholders = $r->symbols or whatever ... now it's more coherent.
23:49 GitHub67 joined #mojo
23:49 GitHub67 [mojo] kraih pushed 1 new commit to master: http://git.io/Gy45Bw
23:49 GitHub67 [mojo/master] small optimization - Sebastian Riedel
23:49 GitHub67 left #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary