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

IRC log for #mojo, 2016-11-29

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

All times shown according to UTC.

Time Nick Message
00:44 zivester joined #mojo
00:52 aborazmeh joined #mojo
01:03 stryx` joined #mojo
01:15 zivester joined #mojo
01:49 Paddi joined #mojo
02:03 Yysachinyy joined #mojo
03:23 noganex joined #mojo
03:32 asarch joined #mojo
04:05 jabberwok joined #mojo
04:10 lluad joined #mojo
04:37 inokenty-w joined #mojo
05:04 dboehmer joined #mojo
06:01 Paddi joined #mojo
06:03 dantti_laptop joined #mojo
06:15 bc547 joined #mojo
06:32 dod joined #mojo
06:36 Paddi joined #mojo
06:55 dod joined #mojo
07:21 dod joined #mojo
07:34 CHYC joined #mojo
07:42 mbudde joined #mojo
08:00 AndrewIsh joined #mojo
08:11 CandyAngel jberger: I can reproduce 1011. Looking intobthe cause now.
08:27 CandyAngel Ah  not the same. I get the uninitialised value, but the test passes anyway
08:29 trone joined #mojo
08:39 rshadow joined #mojo
09:18 CandyAngel Is it worth me looking into why $c->{requests} is undefined around that failing test?
09:18 CandyAngel Doesnt seem to be the cause of it because it passes here, but seems like an unexpected state
09:22 * sri will look into https://progress.opensuse.org/issues/13876#note-23 now, if anyone has some thoughts please poke me
09:23 sri think one race condition is unavoidable actually
09:25 sri imagine the keep-alive HTTP connection between ua and hypnotoad worker is currently idle, then the worker starts the graceful shutdown, and in the exact moment the worker shuts down the ua sends a new http request
09:25 sri the connection might not get closed fast enough, and the HTTP request might already be on its way
09:26 sri it will result in a connection error
09:26 sri (or in the case of mod_proxy as a bad gateway error from apache)
09:27 sri think we can only reduce the chance to make it highly unlikely to ever occur
09:28 coolo sri: then how do you close keep-alive connections when not shutting down?
09:29 sri coolo: good point actually, normally after they have reached the maximum number of requests cleanly with a Connection: close header, or TCP close after a timeout
09:29 sri there's a race condition too
09:30 sri that's the inactivity timeout
09:31 coolo I guess apache expects that for keepalive?
09:32 sri you can't really expect the inactivity timeout
09:34 sri normally it's just not a problem
09:34 sri it's just the race, when mod_proxy send a new request that very moment the connection gets closed
09:34 osfabibisi joined #mojo
09:35 sri then you get bad gateway
09:36 sri it's much much more rare than the current openQA problem, but it's there
09:41 sri guess it might not even be worth thinking too much about
09:41 sri same problem can happen with any http connection where the server times out keep-alive connections, which is pretty much all
09:43 sri what we have to do in mojolicious is to stop accepting new keep-alive requests if the worker initiated a graceful shutdown
09:46 sri coolo: good thing is, the unavoidable race condition happens only on the client side, and results in quick errors, never interrupted requests on the server side
09:49 sri so, the obvious solution would be to set $self->max_requests(1) on worker shutdown, that would make all requests currently in progress end with a Connection: close
09:49 sri but that doesn't have an effect on idle connections
09:50 sri so, i guess idle connections need to be closed right away
09:50 sri at least http connections
09:51 sri websockets will have to time out
09:53 CandyAngel Seem Mojolicous i losing track of the websocket. I added a $tx->on(finish..) in Mojo Server Daemon and I dont get it on that test
10:00 CandyAngel Ohh.. it is being closed, then getting nother request!
10:10 sri guess to make a clean-ish API i could add Mojo::Server::Daemon::drop_idle_connections() or so
10:13 cpan_mojo Mojo-Zabbix-0.07 by ORANGE https://metacpan.org/release/ORANGE/Mojo-Zabbix-0.07
10:47 CandyAngel added my findings to 1011, hope it helps
10:53 tchaves joined #mojo
11:02 jkramer joined #mojo
11:02 jkramer Ahoy
11:04 jkramer I just created this excellent issue https://github.com/kraih/mojo/issues/1020
11:06 Yysachinyy joined #mojo
11:08 sri jkramer: seems hard to test
11:10 jkramer The return value of syswrite? Or reproducing the problem?
11:11 sri jberger: you also forgot to mention the other place the same problem appears
11:11 sri umm
11:11 sri jkramer
11:12 sri i guess you'd have to propose a better idiom for the problem that works in both cases
11:13 jkramer Which other place?
11:13 sri Mojo::Asset::File
11:13 purl Mojo::Asset::File is *not* a general purpose module for interacting with files
11:13 * sri pats purl
11:13 * purl stabs
11:13 jkramer Actually I fell over this problem using Mojo::Asset::
11:14 jkramer ->move_to wrote incomplete files to disk after a download and it took ages to find out what the problem was since it didn't report the problem
11:15 sri well, you know what to do now
11:15 jkramer Not really o_O
11:16 sri find us a better idiom
11:16 sri ideally with references to prior uses
11:20 jkramer I just thought I'd report it since it's a serious pitfall IMO and the fix is very simple, but I really don't have time for these formalities.
11:20 CandyAngel ah, thanks purl
11:21 sugar joined #mojo
11:23 CandyAngel is there a reason (aside from linecount) why there isnt n upgrade method d on mojo asset memory?
11:24 CandyAngel Typing on laggy phone sucks :P
11:25 Adurah Memory upgrades huh... http://downloadmoreram.com/ !
11:26 rshadow joined #mojo
11:39 sri jberger: ok, i was about to ask a few more questions to make a proposal myself... but if you don't have time
11:39 sri argh
11:39 sri jkramer
11:39 sri again...
11:39 purl Nothin' up my sleeve.  Presto!
11:40 sri jkramer: guess we'll be leaving your issue open until someone volunteers
11:43 aborazmeh joined #mojo
11:50 bobkare sri: maybe something like this can be a hack for testing? local *IO::Handle::syswrite = sub { $!=0; return 42 };
11:51 sri bobkare: good idea
11:53 bobkare and it's not particularily pretty, but ($file->syswrite($content)//-1) == length($content) or croak ... seems to work in my q&d test
11:54 sri looks reasonable too
12:01 bobkare want me to add it to the issue?
12:01 sri or send a pull request, you have all the building blocks already
12:02 Yysachinyy joined #mojo
12:03 dod joined #mojo
12:04 bobkare Don't have time to do a full patch now, might return to it later if nobody beats me to it
12:16 jkramer sri: Ask away, but I'm a bit busy with my day job :)
12:22 gryphon joined #mojo
12:41 dboehmer joined #mojo
12:57 dantti_laptop joined #mojo
13:05 itaipu joined #mojo
13:09 sri hmm, fixing graceful worker shutdowns is harder than expected
13:10 sri we have tests depending on the broken behavior :S
13:15 zivester joined #mojo
13:16 Lee joined #mojo
13:45 sri ouch
13:45 sri and there's another timing problem
13:46 sri i can't just close idle connections on $ioloop->on(finish => sub {...})
13:48 sri because that event also gets emitted here https://github.com/kraih/mojo/blob/master/lib/Mojo/IOLoop.pm#L119
13:48 sri right after a fresh connection has been accepted
13:50 sri oh
13:50 sri i guess idle connections have had a previous request
13:50 sri yea
13:50 sri a conection is idle if it doesn't currently own a transaction, but has had previous requests
13:50 * sri nods
13:59 sri my patch so far https://gist.github.com/anonymous/3c6775028f35610a1835ec640eada5e8
13:59 sri you can ignore the tests prety much, they need more reworking
14:00 osfabibisi joined #mojo
14:00 sri the idea is to close connections much faster once graceful shutdown has been intiated
14:01 sri by disallowing keep-alive requests during graceful shutdowns
14:01 marty joined #mojo
14:05 sri jberger: maybe you could take a quick look
14:07 sri i think the functionality should be mostly right, but the method name and where to put it i'm very unsure about
14:08 sri especially considering that Mojo::UserAgent might be getting the same method at some point in the future
14:08 sri (people regularly ask for a method to clear the keep-alive queue)
14:09 gizmomathboy joined #mojo
14:12 marty joined #mojo
14:15 ramortegui joined #mojo
14:16 sri guess this means we can now be more specific in the docs about how to choose timeouts
14:17 sri like, the graceful_timeout can now be described as a little bit longer than the longest request you expect to be handling
14:21 Pyritic joined #mojo
14:22 jacoby_ joined #mojo
14:29 marty_ joined #mojo
14:31 howitdo joined #mojo
15:44 sri so, it seems someone here thinks the way i handled the two pull request thing earlier was unreasonable
15:44 sri and complained about my behavior to jberger (who of course did not disclose who it was)
15:44 sri let me clear a few things up
15:45 sri a) i don't mind multiple pull requests with different solutions to the same problem
15:45 sri b) but i was expecting actually different approaches, with well reasoned descriptions for why each approach should be chosen
15:46 sri not just formatting differences
15:46 sri https://github.com/kraih/mojo/pull/1019#issuecomment-263549503
15:48 sri i wrote that response because i felt that to be a huge waste of everyones time
15:49 sri if the formatting is off we can comment on it and get it fixed, we do not need to spend valuable time reviewing multiple versions without significant differences
15:49 zivester joined #mojo
15:54 asarch joined #mojo
15:58 tyldis :)
16:00 lluad joined #mojo
16:01 jberger it takes a while to learn how to make effective PRs, even per-community, hopefully all parties involved can learn something from this
16:02 jberger and just a reminder, we can ALL (including me) always try to be nicer to each other
16:03 jberger I might have been a bit too gruff with dboehmer_ yesterday in the discussion of logging
16:03 jberger I apologize for that
16:08 sugar joined #mojo
16:13 laidback_01 joined #mojo
16:16 exp-innit silly question, i'd like to route /path/somestaticstring and /path/:id to different controller subs
16:16 exp-innit is this a thing that's supported by default? or should i use /path_somestaticstring and /path/:id ?
16:22 sri routes are fifo, just put the more specific ones first
16:26 sri argh, my test case for the close_idle_connections functionality got pretty wild
16:26 exp-innit i did that sri but no joy, it's possible i didn't kill the server well enough
16:26 * exp-innit kills with a vengeance
16:27 exp-innit aye that did the job, muchos gracias
16:27 sri i sometimes wonder if recurring timers should get their id as an argument to the callback
16:34 Adura_ joined #mojo
16:43 sri jberger, marcus, batman, tempire, crab: please review https://github.com/kraih/mojo/commit/02049ddabb93e07699edab6ad28f208d4064daf4
16:43 sri this one was really hard to fix
16:44 sri test coverage and reliability should have gone way up though
16:45 yysachinyy joined #mojo
16:56 * jberger reads
16:59 jberger why all the scalar references?
17:00 jberger https://github.com/kraih/mojo/commit/02049ddabb93e07699edab6ad28f208d4064daf4#diff-40a26c91d813002589fce23cfe263cf3R81
17:00 sri escaped
17:00 sri not ref
17:01 sri it's a heredoc for rewriting the app script
17:01 sri you know, testing zero downtime upgrades
17:01 CW Does Mojolicious have nested pages?
17:02 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Partial-templates
17:02 CW Awesome, Thanks...
17:02 jberger oh ok, man, I had to expand the diff quite a bit to see that
17:04 sri if i screwed up with the fix that could end up being rather expensive for some mojo users ;p
17:05 sri as in dropped connections, requests never getting a response... and so on
17:09 jberger I wonder if the finish event should only be attached in the sig handler?
17:09 jberger is it possible that people might start/stop the loop in other ways?
17:10 jberger trying to emulate condvars (badly)?
17:13 rshadow joined #mojo
17:18 sri jberger: the ioloop stops itself too
17:18 sri it's not tied to the signal
17:18 sri see accept limit
17:19 jberger hmmm, true
17:19 sri in fact i had a big problem there
17:19 sri because ioloop would emit the finish event right after accepting a new connection (the last one)
17:20 sri which meant that the new connection looked idle
17:20 sri because it had no transaction yet
17:20 sri and i discarded a fresh connection right away with a too eager idle connection killer
17:21 gryphon joined #mojo
17:21 sri but even that lat connection should at least handle one request, but no more
17:21 sri *last
17:21 sri s/at least//
17:21 sri ;p
17:22 dod joined #mojo
17:24 good_news_everyon joined #mojo
17:24 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v1mZe
17:24 good_news_everyon mojo/master 903feb8 Sebastian Riedel: fix bugs in Mojo::Util and Mojo::Asset::File where incomplete writes would not be recognized as errors (closes #1020)
17:24 good_news_everyon left #mojo
17:27 rshadow joined #mojo
17:28 jberger yeah, that logic sounds very complex, I worry about my ability to review it
17:29 jberger the code looks sane, but I don't know if I can analyze the mechanism/logic for flaws
17:29 jberger I know we don't do dev releases commonly, but is this a possible reason to?
17:32 good_news_everyon joined #mojo
17:32 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v1mZh
17:32 good_news_everyon mojo/master 303018b Sebastian Riedel: be more specific about reasons
17:32 good_news_everyon left #mojo
17:37 sri nobody tests those
17:38 jberger we'd have to ask people to
17:39 sri nobody's gonna do that ;p
17:39 sri we are all too busy
17:41 jberger and even then this is a load thing, right? so if people deployed in the dev environment they probably wouldn't see any problem (unless they are setup to load test in their dev environment)
17:43 sri yes, if it was easily testable we would test it
17:44 rshadow joined #mojo
17:46 irqq joined #mojo
17:46 Lee_ joined #mojo
17:59 stryx` joined #mojo
18:00 Pyritic joined #mojo
18:15 rshadow joined #mojo
18:21 sugar joined #mojo
19:19 sugar joined #mojo
19:27 rshadow joined #mojo
19:38 dod joined #mojo
19:47 rshadow joined #mojo
20:00 PryMar56 joined #mojo
20:01 karjala Is there any chance Perl will ever have async/await like ES7?
20:02 preaction yes
20:02 karjala where do you base that? are they working on it?
20:03 preaction leonerd is/was
20:03 karjala what's his PAUSE ID / irc nick?
20:04 Grinnz PEVANS
20:04 Grinnz and leonerd
20:04 karjala cool
20:06 Grinnz http://www.nntp.perl.org/group/perl.perl5.porters/2016/07/msg237518.html http://www.nntp.perl.org/group/perl.perl5.porters/2016/07/msg237517.html http://www.nntp.perl.org/group/perl.perl5.porters/2016/07/msg237516.html
20:06 Grinnz that was the last sort of discussion about it
20:06 rshadow joined #mojo
20:06 Grinnz you could probably discuss it in #p5p on this network
20:06 karjala thanks
20:07 karjala It would go well with Mojolicious, I think
20:07 karjala it being async and all
20:09 irqq joined #mojo
20:14 stryx` joined #mojo
20:38 sri guess we could remove the experimental note from Mojo::IOLoop::subprocess
20:39 sri or maybe not yet
20:57 gryphon joined #mojo
21:07 PopeFelix joined #mojo
21:28 dod joined #mojo
21:36 itaipu joined #mojo
22:07 howitdo joined #mojo
22:18 q_gone joined #mojo
22:20 tyldis joined #mojo
22:39 sri allright, unless someone complains i'll upload a new release tomorrow
22:41 jberger I'm pretty excited about that log change
22:41 jberger I'm going to be able to use that right away
22:49 sri ye, that's nice
22:50 sugar joined #mojo
22:53 jberger Now my only thought is that it would be nice to have a way too load configuration earlier
22:54 jberger A semi-evil way to do that would be to wrap new (a la before)
22:56 jberger (Not all that evil I guess)
22:57 jberger s/too/to/
23:00 sri i just had a funny idea
23:05 good_news_everyon joined #mojo
23:05 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v1Ys0
23:05 good_news_everyon mojo/master b30fe9c Sebastian Riedel: LAZILY INITIALIZE ALL THE THINGS
23:05 good_news_everyon left #mojo
23:05 * sri pokes jberger
23:10 good_news_everyon joined #mojo
23:10 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v1YGe
23:10 good_news_everyon mojo/master caab686 Sebastian Riedel: use a little less code
23:10 good_news_everyon left #mojo
23:11 sri makes app->home more configurable
23:12 sri you can change the home directory much later now
23:16 sri oh, hmm, the plugins initialize the renderer early
23:25 sri :/
23:25 good_news_everyon joined #mojo
23:25 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v1YcT
23:25 good_news_everyon mojo/master e76f383 Sebastian Riedel: not everything can be initialized lazily
23:25 good_news_everyon left #mojo
23:36 cfedde joined #mojo
23:42 marty joined #mojo

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