The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2016-04-13

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

All times shown according to UTC.

Time Nick Message
00:02 woz joined #mojo
00:02 jberger hunh, another report of a 406 elsewhere in the toolchain
00:02 * jberger digs
01:01 asarch joined #mojo
01:11 zivester joined #mojo
01:18 tchaves joined #mojo
02:01 tchaves joined #mojo
02:03 woz joined #mojo
02:42 noganex joined #mojo
02:58 mcsnolte joined #mojo
03:05 woz joined #mojo
03:43 jzawodn joined #mojo
04:15 mib_6my8uc joined #mojo
04:50 human39 joined #mojo
05:03 Guest-guest joined #mojo
05:06 woz joined #mojo
05:12 inokenty-w joined #mojo
05:19 melo joined #mojo
05:37 abra_ joined #mojo
06:02 woz joined #mojo
06:24 trone joined #mojo
06:28 cpan_mojo Mojolicious-Plugin-Riotjs-0.06 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-Riotjs-0.06
06:31 salva joined #mojo
06:36 cpan_mojo Mojolicious-Plugin-Bootstrap3-3.3601 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-Bootstrap3-3.3601
06:37 woz joined #mojo
06:46 crab i wonder if SKIP LOCKED in postgres 9.5 might be useful for minion
06:50 dod joined #mojo
06:51 batman i think sri already thought about that...
06:52 batman crab: http://irclog.perlgeek.de/mojo/2016-02-16#i_12050182
06:52 batman http://irclog.perlgeek.de/mojo/search/?nick=sri&q=skip+locked there's more :)
06:55 dod joined #mojo
07:02 jasanj joined #mojo
07:22 cpan_mojo Mojo-Weixin-1.1.0 by SJDY https://metacpan.org/release/SJDY/Mojo-Weixin-1.1.0
07:24 trone joined #mojo
07:28 memowe joined #mojo
07:29 memowe \o/
07:32 AndrewIsh joined #mojo
07:50 woz joined #mojo
08:02 osfabibisi joined #mojo
08:17 HtbaaPi joined #mojo
08:28 melo1 joined #mojo
08:31 Vandal joined #mojo
08:41 HtbaaPi joined #mojo
08:53 melo joined #mojo
09:33 arthas joined #mojo
09:35 HtbaaPi joined #mojo
09:44 jzawodn joined #mojo
09:51 woz joined #mojo
09:57 HtbaaPi joined #mojo
10:21 memowe_ joined #mojo
10:25 HtbaaPi joined #mojo
10:34 Kripton joined #mojo
10:34 dod joined #mojo
10:53 woz joined #mojo
10:58 tchaves joined #mojo
11:05 jasanj I have server non-blocking job, want to stop ioloop when all of them finished
11:06 jasanj any suggestion ?
11:07 batman jasanj: what do you mean about "server" ?
11:08 batman is it a mojo web server?
11:08 jasanj batman:  sorry i mean several
11:10 pink_mist won't the IOLoop end by itself if it has nothing more to do? i.e. no more callbacks to run, and no handles to read from/write to?
11:10 * pink_mist doesn't know, but that sounds like the sane thing to do
11:12 batman pink_mist: yeah, it should stop
11:13 batman jasanj: are you sure you don't just want to use Mojo::IOLoop->delay(@steps)->wait; ?
11:14 jasanj i don't know the ioloop will stop by itself when no watcher running, so my problem not exist now
11:14 melo joined #mojo
11:15 jasanj batman: haven't use ->delay, i'll check it out
11:15 jasanj thanks
11:15 batman jasanj: https://metacpan.org/pod/Mojo::IOLoop#delay
11:17 HtbaaPi_ joined #mojo
11:19 tchaves joined #mojo
11:21 Kripton joined #mojo
11:31 memowe joined #mojo
11:32 sebbe Hey. We just upgraded from 6.50 to 6.58 a few hours ago and experienced some pretty wild memory usage on our webservers: https://i.imgur.com/pok9Ose.png - It started pretty much when we did the upgrade, and ended when we reverted it, so we're currently suspecting that there's been introduced some kind of memory leak.
11:36 sebbe We were wondering if anyone in here has an idea what could be to blame?
11:37 pink_mist can you try doing incremental upgrades via 6.51, 6.52, 6.53 and so on? that would probably help narrow it down
11:48 tchaves joined #mojo
11:52 pink_mist sebbe: there were some defaults that were increased (default max_requests from 25 to 100 and default accepts from 1000 to 10000) in 6.53 ... those might be affecting you perhaps?
11:52 batman pink_mist: good point. maybe it's the actual application that leaks instead of mojo
11:55 sebbe pink_mist: We can try bisecting, yes. We only experience it on our production servers, so we'd have to do the bisection there, which is a bit finnicky. We'll probably get around to doing that in a bit; we just thought we'd ask here since it might ring a bell for sri or someone else.
11:55 pink_mist sebbe: well start with checking 6.52, and if that one's alright, try 6.53
11:56 sebbe pink_mist: Thanks. We'll report back in a bit. :)
11:58 Lee changing those defaults in the config should be an easy way to prove if it's those changes
11:59 pink_mist true as well
11:59 melo joined #mojo
12:05 bc547_ joined #mojo
12:45 melo joined #mojo
12:55 woz joined #mojo
13:00 abra joined #mojo
13:01 ramortegui joined #mojo
13:07 asarch joined #mojo
13:40 mcsnolte joined #mojo
13:41 dod joined #mojo
13:50 sebbe pink_mist: Thanks! Turns out it was the increased value of accepts. We had misunderstood what that option meant. Good to know.
13:53 jacoby joined #mojo
13:54 dantti_laptop joined #mojo
14:22 annaken joined #mojo
14:31 dod joined #mojo
14:38 jberger http://www.nojitter.com/post/240171589/apple-jumps-on-the-webrtc-bandwagon
14:44 cpan_mojo Mojolicious-Plugin-PlainRoutes-0.06 by CTHOR https://metacpan.org/release/CTHOR/Mojolicious-Plugin-PlainRoutes-0.06
14:55 meshl joined #mojo
14:56 woz joined #mojo
15:24 PryMar56 joined #mojo
15:27 lluad joined #mojo
15:40 sri crab: minion already uses skip locked :)
15:42 sri and upsert actually
15:43 sri USE ALL THE POSTGRES 9.5 FEATURES
15:43 jberger postgres' upsert is so nice
15:44 sri minion 5.0 was a really good release, skip locked, upsert and the new index have increased the performance a lot (orders of magnitude)
15:46 jberger ok I'm sure I'm gonna have a head-slap moment when someone helps me here but I'm getting really crazy results
15:47 jberger when I do %= url_for '/some/path' in a tempalte
15:47 jberger I'm getting /path/to/current/route in the result
15:47 jberger how is that even possible?
15:49 daxim joined #mojo
15:50 daxim can anyone help me with <https://github.com/yuki-kimoto/gitprep/issues/87>?
15:50 sri http://mojolicious.org/perldoc/Mojo/Server/Daemon#listen
15:52 daxim where is the [::] notation coming from?
15:52 daxim I only knew about [::1]
15:52 sri it's the ipv6 version of 0.0.0.0
15:54 sri or rather, the shorthand for it
15:56 jberger sri: what does the stash value "path" do?
15:57 sri prefix for embedded apps
15:57 jberger *reserved stash value
15:57 jberger ahhhhhhh
15:57 * jberger unborks his code
15:57 jberger I recognize most of the reserved values, didn't know about that one
15:58 woz joined #mojo
15:58 sri in retrospect, i might have named it path_info or so if i had to do it again
15:58 sri wonder if it could be made private as mojo.path
15:59 sri it's only mentioned once, and not in a context where the user sets it
16:00 jberger I went back to my controller code and commented out everything but render and started working back until it started doing the wrong thin
16:00 jberger g
16:00 jberger I stash a value called path that points to something else needed in the template
16:00 jberger boom
16:01 jberger easy enough for me to rename, but it was very confusing until then
16:01 jberger hmmm, let me check to see if MountPSGI needs it ...
16:02 sri or is there a good reason to have it public?
16:02 jberger sri: can you point me to its use in the code?
16:03 jberger it seems that MountPSGI doesn't use it, but perhaps it should be
16:03 sri utl_for uses it
16:03 sri umm
16:03 sri url_for
16:03 jberger ha, well, I should have expected that, given my problems
16:03 jberger :P
16:05 dod joined #mojo
16:05 jberger so MountPSGI uses a pass-in "rewrite" parameter that looks very similar to how the path stash value is used in url_for
16:06 jberger https://metacpan.org/source/JBERGER/Mojolicious-Plugin-MountPSGI-0.11/lib/Mojolicious/Plugin/MountPSGI/Proxy.pm#L71-74
16:07 jberger if that should be using the path stash value then perhaps its worth keeping public (and patching MountPSGI to use it)
16:07 dod joined #mojo
16:08 sri are you using embedded apps?
16:09 jberger MountPSGI is a wrapper for that, yes: https://metacpan.org/source/JBERGER/Mojolicious-Plugin-MountPSGI-0.11/lib/Mojolicious/Plugin/MountPSGI.pm#L40
16:09 jberger it builds a proxy app for the psgi application and mounts it
16:09 sri oh
16:10 jberger if that code sucks, then its marcus's, if its good then I've been doing most of the work on it lately ;-P
16:11 * jberger throws marcus under the bus
16:11 sri lol
16:11 jberger Test::Mojo::Role::PSGI uses MountPSGI to mount the psgi application at / and then hands it to Test::Mojo for testing
16:12 jberger and writing THAT is what got me involved in MountPSGI
16:12 jberger and so I rarely mount anything anywhere but /
16:59 woz joined #mojo
17:25 meshl joined #mojo
17:27 dantti_laptop hi, can someone explain to me how in "http://tempi.re/a-mojolicious-non-blocking-web-service-why-" the $ua->get() works? I mean if the sub / returns wouldn't the request be closed? I'm trying to understand the async glue to have some inspiration :)
17:28 sri http://mojolicious.org/perldoc/Mojolicious/Guides/FAQ#What-is-the-difference-between-blocking-and-non-blocking-operations
17:29 dantti_laptop for the context I used to use Catalyst quite liked it, but my perl debug skills suck so I sort of rewrote it in C++/Qt, and doing things async is easy there if you start local event loops (ie QEventLoop::exec()), but that's a bit verbose so I'm studing other approaches API wise
17:30 dantti_laptop sri: I understand the difference I don't understand the implementation (or maybe syntax) :)
17:32 dantti_laptop like in catalyst once the sub is finished, you get finishedHeaders and finishedBody auto called
17:32 dantti_laptop what do you differently to know when there's an async call to wait?
17:34 sri we don't make that assumption
17:35 dantti_laptop so this never closes the connection? get '/' => {text => 'I ♥ Mojolicious!'};
17:37 sri i don't know what a connection close has to do with any of this
17:37 sri you're mixing a lot of things
17:38 preaction dantti_laptop: if you never call $c->render(), mojolicious assumes it's waiting for something async. you can see that in the log when it happens. you can explicitly declare it with $c->render_later;
17:38 dantti_laptop well how do you magically send headers/body? I mean if in get '/' => { callAsync(); return }; wouldn't after return you send them?
17:39 preaction yes
17:39 dantti_laptop preaction: then on the above I love Mojolicious that will "wait" for ever?
17:39 preaction though you likely have to pass in the controller to callAsync(), since the controller has the transaction (the connection)
17:39 preaction no. there is an inactivity timeout
17:39 preaction these are all things you can see for yourself, as they are all logged when they happen
17:41 preaction also, that snippet with just text is just text. there's nothing to wait for, so why would it wait?
17:42 dantti_laptop ok, so you don't create local event loops, intead you pass the $c to your async things which are supposed to call $c->render() when done right?
17:43 dantti_laptop I guess then if you have 3 async calls to make you will have 3 "finish" lambdas (if that's the perl name) until last one calls render()?
17:43 preaction right. or you use the delay() helper
17:44 dantti_laptop which is basically a local event loop as it seems by the docs
17:45 jberger delay has more learning curve than the rest of it
17:45 preaction no, it's part of the global event loop
17:45 jberger its spectacular once you grok it
17:45 jberger but it takes grokking
17:46 dantti_laptop preaction: hmm doesn't when you call wait it waits for begin to get called (or go out of scope) so that code after wait continues?
17:47 preaction yes, but it doesn't block other code from running. only one event loop can be running at a time, otherwise it's not a loop
17:51 jberger dantti_laptop: I'd suggest getting comfortable with simple callback style (called continuation passing style)
17:51 dantti_laptop right, it's just that we call a local event loop when you create a QEventLoop l; and call l.exec(), it will return to main loop until l.quit() is finished
17:51 jberger once you are comfortable with that, then move on to delay
17:51 jberger QEventLoop?
17:52 dantti_laptop jberger: I'm actually more studing the api than trying to use it :)
17:52 dantti_laptop I shameless stated that on my second message
17:52 kaare joined #mojo
17:52 jberger ah, I missed that one
17:53 jberger I'm a big fan of the delay object, but I don't have time to go through it for discussion's sake atm
17:53 dantti_laptop jberger: I wrote Cutelyst a Catalyst clone in C++/Qt, now I'm thinking on ways to make it async friendly
17:53 jberger I do have a blog post series on it if you want to start there
17:54 jberger http://blogs.perl.org/users/joel_berger/2013/10/writing-non-blocking-applications-with-mojolicious-part-1.html
17:54 dantti_laptop jberger: where do I find? I'm looking for inspiration
17:54 dantti_laptop thanks
17:54 jberger three parts, plus a followup
17:54 preaction so... you're translating Mojo to C++ then?
17:54 dantti_laptop ok will take a look
17:54 dantti_laptop preaction: well I think mojo syntax is not easily possible in C++, but the async concepts could be used
17:55 sri mojolicious is very different from catalyst
17:55 preaction the Mojolicious::Lite syntax, sure. but the regular Mojolicious seems perfectly doable in C++
17:56 dantti_laptop ie sub index() :Args(0) { .. } is replaced by C_ATTR(index, :Args(0) ) void index(Context *c) {.. }
17:56 dantti_laptop C_ATTR register this to Qt moc compiler so I can introspect the classes
17:56 jberger dantti_laptop: http://blogs.perl.org/users/joel_berger/non-blocking/
17:56 dantti_laptop sri:  yeah it's a new magic to me :)
17:57 dantti_laptop preaction: what is regular Mojolicious?
17:57 ribasushi joined #mojo
17:57 jberger dantti_laptop: fully OO
17:57 jberger ::Lite is a sugar syntax for small apps
17:58 dantti_laptop right
17:59 dantti_laptop there is a C++ framework that does something a bit similar using a macro and lambdas now that C++11 has it, but indeed only works for small apps as the whole code gets into single file
18:00 dantti_laptop btw there is something I don't quite understand about the "async hype" if you have a db oriented app even if you use async won't you get into same issues of non-blocking, being limited by db concurrency?
18:02 jberger dantti_laptop: but your server can move on to other clients in the meantime
18:02 kaare joined #mojo
18:02 dantti_laptop since cutelyst process takes 1.5mb each 1000 gives me 1.5gb of ram, using threads it's around 150mb but still the sql server needs to deal with that
18:02 dantti_laptop jberger: but what if all of them needs to make a query?
18:02 jberger dantti_laptop: then you needed a bigger db
18:03 dantti_laptop you end up with a huge queue
18:03 jberger and probably some caching where possible
18:03 jberger dantti_laptop: send your read queries to slave db instances
18:04 dantti_laptop ok, so am I wrong to think that async scalability is more about ram usage?
18:04 jberger use memcached or redis for frequent queries
18:04 jberger dantti_laptop: that is a major feature yes
18:04 preaction performance is about clearing bottlenecks, not ignoring one because the other is worse
18:04 jberger don't need to fork as much
18:04 jberger or more like, each fork can server more clients
18:04 dantti_laptop because to avoid DoS you'd probably limit the front server client limit anyway right?
18:04 preaction you'd do that at the firewall
18:04 jberger dantti_laptop: you really are spraying to all fields here
18:05 jberger sorry, /me gets back to work
18:05 dantti_laptop jberger: sorry if I'm off topic
18:05 jberger just too theoretical of a conversation for me to have on $work time
18:06 dantti_laptop jberger: sure, I just dunno about a channel that I could ask those
18:06 sri nobody here really cares about catalyst
18:07 jberger dantti_laptop: non-blocking theory is on topic (probably) but I just can't spend the time now
18:07 dantti_laptop ok, thanks for you time anyway
18:07 jberger np
18:08 jberger I can justify answering questions on work time because the health of mojo affects our business
18:08 jberger but that has limits :-P
18:08 kaare_ joined #mojo
18:09 dantti_laptop jberger: sure, I'm at work too, and I understand lengthy conversations is unfourtunate depending on schedule...
18:10 cpan_mojo Mojo-UserAgent-Mockable-1.22 by POPEFELIX https://metacpan.org/release/POPEFELIX/Mojo-UserAgent-Mockable-1.22
18:37 Kripton joined #mojo
18:44 batman joined #mojo
18:45 chansen joined #mojo
18:55 Kripton joined #mojo
19:07 bjakubski joined #mojo
19:46 Kripton joined #mojo
19:47 cpan_mojo Mojo-UserAgent-Mockable-1.23 by POPEFELIX https://metacpan.org/release/POPEFELIX/Mojo-UserAgent-Mockable-1.23
19:47 woz joined #mojo
19:55 Kripton joined #mojo
20:42 punter joined #mojo
20:49 woz joined #mojo
20:49 berov joined #mojo
20:51 berov HI Guys, Previously $c->url_for($aroutename) worked fine and now It does not.
20:52 berov How to change my $c->url_for($someroute->name) so a proper url is generated
20:52 preaction what happened in between it working and not working?
20:53 berov I think several versions of Mojolicious happened - about an year ago since now :)
20:54 berov I tryed $c->url_for($someroute->render)
20:55 berov this works, but I do not always have a route object at hand. I sometimes know only the route name
20:55 berov I look at url_for  the code to handle a route name is still there
20:58 jberger route names still work
20:58 jberger are there capture groups that you aren't providing?
20:58 jberger and when you say "doesn't work" what does it do?
20:59 berov url_for returns the route name unchanged
20:59 berov no url generated
21:00 berov My code did not change for an year. now magically stopped
21:00 berov by saying now I mean I run a test yesterday
21:03 berov My example: got: 'testatiicreate' expected: '/testatii/create'
21:03 berov http://www.cpantesters.org/cpan/report/ec5c8c3f-6bf3-1014-a287-2518b9451c60
21:03 berov the route name is 'testatiicreate'
21:03 berov automaticaly generated
21:06 berov I have several such cases and all are failing now with 6.58
21:09 jberger berov: where do those routes get defined?
21:10 berov jberger:  let me remind my self, but what do you mean by "where"
21:11 jberger $r->get('/testatii/create')
21:11 jberger can you link me to that line?
21:11 jberger s/get/whatever_method/
21:11 berov a
21:11 berov moment
21:12 jberger and note that you can do ./myapp routes
21:12 jberger to get a route dump
21:16 berov jberger:  it is too dynamic :) created only for the test. I create a plugin and the test it
21:16 jberger berov: do you create the routes after serving some pages?
21:17 berov possibly
21:17 berov what is the trick?
21:18 jberger that was never allowed
21:18 jberger it accidentally worked sometimes
21:19 jberger http://mojolicious.org/perldoc/Mojolicious/Guides/Routing#Rearranging-routes
21:20 jberger "From application startup until the first request has arrived, all routes can still be moved around or even removed with methods like "add_child" in Mojolicious::Routes::Route and "remove" in Mojolicious::Routes::Route."
21:20 berov ah Now I see that I have the same comment in my test
21:23 berov jberger: thank you for pointing me to the right direction
21:23 jberger np
22:01 woz joined #mojo
22:04 berov left #mojo
22:09 sri so, nobody made a boolean patch for Mojo::Pg?
22:19 meshl joined #mojo
22:21 jberger I haven't had time since :s
22:22 jberger put it another way, have you ever seen me turn down a nice theoretical discussion of non-blocking architecture before?
22:23 bpmedley SmokeMachine: Did you get your Mojo::IOLoop::Tail issue working?
22:25 SmokeMachine That line worked... But looks a little "strange"
22:26 bpmedley Ok, let me think about a proper addition; which could be a bit.. work has required more hours as of late.
22:28 SmokeMachine $tail->ioloop->reactor->remove($tail) # or something like that (on mobile, sorry)
22:36 punter joined #mojo
22:48 ZoffixMobile joined #mojo
23:04 woz joined #mojo

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