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

IRC log for #mojo, 2015-02-12

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

All times shown according to UTC.

Time Nick Message
00:00 cfedde Under plugin Mount I'm not seeing logging from the mounted apps.  What might I be doing wrong?
00:02 sri every app has its own logger
00:04 Ptolemarch joined #mojo
00:14 * sri wonders if Mojo::Message::text should try decoding with UTF-8 if the Content-Type header did not contain a charset value
00:14 sri Mojo::Message::dom uses Mojo::Message::text for decoding
00:16 sri because https://github.com/kraih/mojo/issues/740
00:18 chansen If you Will try to sniff the encoding use an apri
00:19 chansen ..ate implementation
00:20 sri i don't want to
00:20 sri utf-8 is a fair assumption on the web these days
00:22 chansen One of the reasons i developed unicode::UTF8
00:23 good_news_everyon joined #mojo
00:23 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/NZEX
00:23 good_news_everyon mojo/master 6df30fc Sebastian Riedel: better response tests
00:23 good_news_everyon left #mojo
00:24 cfedde ah. so the "main" app logs the GET/POST but the mounted app logs the oter stuff.
00:26 sri every now and then i want to make mounted apps inherit the logger
00:26 sri at least as part of the Mount plugin
00:27 cfedde Is that a thing I can do in my app today?
00:28 chansen sri: credit for acting fast!
00:29 good_news_everyon joined #mojo
00:29 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/NZz0
00:29 good_news_everyon mojo/master 741131a Sebastian Riedel: show how to share a logger with mounted apps
00:29 good_news_everyon left #mojo
00:32 good_news_everyon joined #mojo
00:32 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/NZg0
00:32 good_news_everyon mojo/master 514fa77 Sebastian Riedel: mention that the mounted app is adjusted
00:32 good_news_everyon left #mojo
00:34 sri btw. making all mounted apps inherit the logger would be as easy as https://gist.github.com/anonymous/2a532b18cd50003ef450
00:34 sri and if we did that, app->log->reopen would make sense again
00:34 sri in combination with a USR1 signal in Mojo::Server::Prefork
00:35 sri (for log rotation)
00:36 skittles_ joined #mojo
00:41 Grinnz_ i want the result, but i don't use mounted apps so i can't comment on the former :P
00:42 sri something like this https://gist.github.com/anonymous/234d8c714885e6d7b77a
00:43 sri i wouldn't want to write the tests though
00:44 sri mount and reopen parts are easy, signals not so much
00:46 Grinnz_ indeed
00:46 sri if someone writes tests for that during the next hour i'll consider the patch ;p
00:56 Grinnz_ sri: is there any default behavior that would set a path for the application log?
00:56 Grinnz_ https://metacpan.org/pod/Mojolicious#mode this seems to imply that it will set a name based on the mode
00:57 Grinnz_ otherwise, it seems kind of useless unless i set the path in startup i guess
00:57 Grinnz_ (for hypnotoad)
00:59 Grinnz_ AH
00:59 Grinnz_ it does, if you have a log/ dir
01:00 good_news_everyon joined #mojo
01:00 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/NZih
01:00 good_news_everyon mojo/master 0c0345d Sebastian Riedel: mention where the dom method gets the message body from
01:00 good_news_everyon left #mojo
01:22 BrassLantern joined #mojo
01:25 BrassLantern joined #mojo
01:33 asarch joined #mojo
01:36 BrassLantern joined #mojo
01:40 zivester joined #mojo
02:22 sri not sure about this one https://gist.github.com/anonymous/cdde4a8ee97c6d42f659
02:24 good_news_everyon joined #mojo
02:24 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/NnTU
02:24 good_news_everyon mojo/master 45027e8 Sebastian Riedel: initialize variables consistently
02:24 good_news_everyon left #mojo
02:25 sri the default_charset is what we try on incoming POST parameters
02:30 bc547 joined #mojo
02:39 sri the more i think about it the more i like it
02:40 sri ->text is all about guessing, and this increases the odds drastically
02:55 klapperl_ joined #mojo
03:01 jontaylor joined #mojo
03:09 noganex_ joined #mojo
03:12 Anon021 joined #mojo
03:22 csson joined #mojo
03:31 good_news_everyon joined #mojo
03:31 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/NnCG
03:31 good_news_everyon mojo/master 32be807 Sebastian Riedel: let the text method use default_charset
03:31 good_news_everyon left #mojo
03:45 Ptolemarch joined #mojo
03:51 good_news_everyon joined #mojo
03:51 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/Nn4c
03:51 good_news_everyon mojo/master 2a6dafc Sebastian Riedel: use || consistently
03:51 good_news_everyon left #mojo
04:11 Grinnz http://grinnz.com/cards/black/rand (usually nsfw text) from https://github.com/Grinnz/cah-cards/blob/master/cah_cards.pl
04:12 Grinnz <3 mojo, pg, and nginx
04:12 Grinnz at least i'll be able to use ONE of those for work
04:12 Grinnz the frontend guys are going to try to convince them to let us split off to our own server and use nginx so they can do websockets
04:12 Grinnz so that would be two, but i'm not counting on it
04:13 preaction i bet you could make CAH on IRC with a moderated channel
04:14 Grinnz this is actually a REST interface so i can have my irc bot ping that instead of the db
04:14 Grinnz lol
04:14 Grinnz not quite for playing a full game though
04:16 preaction hmm... on IRC, would you use white cards though?
04:16 preaction oh! you could have a themed game!
04:17 Grinnz we use it more for a madlibs sort of thing... make up a black card, have the bot pick some white cards... make up some white cards, have the bot pick a black card
04:18 Grinnz or just let the bot pick both of course :)
04:18 preaction i remember playing acro-phobia, when that was a thing. or trivia bots. those were fun
04:19 good_news_everyon joined #mojo
04:19 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/Nnz2
04:19 good_news_everyon mojo/master f5741ec Sebastian Riedel: better description for default_charset
04:19 good_news_everyon left #mojo
04:37 Grinnz btw sri, small suggestion for the config here: https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Cookbook.pod#Nginx
04:38 Grinnz the "X-Forwarded-Proto" header you can just use $scheme
04:38 Grinnz instead of specifying http or https explicitly
04:38 Grinnz i'm not sure if apache has that...
04:39 n2plato joined #mojo
04:40 Grinnz but that is useful for my config, since i have the same server serving http and https
04:41 Grinnz you will notice my earlier link works fine from https as well :)
04:42 * Grinnz wonders when sri sleeps
04:46 good_news_everyon joined #mojo
04:46 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/NnrZ
04:46 good_news_everyon mojo/master faf601a Sebastian Riedel: just use $scheme
04:46 good_news_everyon left #mojo
04:46 sri not yet
04:46 sri Grinnz: you know you could also send a pull request for stuff like that
04:47 Grinnz that seemed a little minor for a pull request :P
04:47 * sri disagrees
04:48 sri it's an actual improvement
04:56 good_news_everyon joined #mojo
04:56 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/NnKq
04:56 good_news_everyon mojo/master 770b1ea Sebastian Riedel: show that the stash can be used for rendering as well
04:56 good_news_everyon left #mojo
05:06 good_news_everyon joined #mojo
05:06 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/NniH
05:06 good_news_everyon mojo/master 13c9fca Sebastian Riedel: just link to attributes
05:06 good_news_everyon left #mojo
05:21 inokenty-w joined #mojo
05:21 good_news_everyon joined #mojo
05:21 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/NnMs
05:21 good_news_everyon mojo/master cdadac9 Sebastian Riedel: link to rendering guide
05:21 good_news_everyon left #mojo
05:23 asarch joined #mojo
05:34 Ptolemarch joined #mojo
05:54 Grinnz sri, slight inconsistency in Mojo::Pg::Database... ->query has the param args start just after the query, but ->do passes its args directly to $dbh->do, so if you have param args you need to put an undef placeholder
05:54 Grinnz doesnt matter to me but thought id mention it
06:00 Grinnz (it also doesnt respect dollaronly, but i dont even remember what postgres function thats useful for)
06:01 Grinnz ah right, its a jsonb thing
06:16 dotandimet joined #mojo
06:34 Insane hi all, how could I increase heartbeat timeout for single controller or for entire application if using hypnotoad?
06:50 marmez joined #mojo
06:55 dotandimet joined #mojo
06:57 marcusr Good morning!
06:57 purl For you maybe.
07:11 Grinnz Insane, https://metacpan.org/pod/Mojo::Server::Hypnotoad#heartbeat_timeout
07:11 Grinnz you can set that in config->{hypnotoad} like so: https://metacpan.org/pod/Mojolicious::Guides::Cookbook#Hypnotoad
07:23 Ptolemarch joined #mojo
07:23 dotandimet joined #mojo
07:35 reneeb joined #mojo
08:01 skittles_ joined #mojo
08:05 reneeb joined #mojo
08:07 eseyman joined #mojo
08:15 Vandal joined #mojo
08:15 Oleg joined #mojo
08:29 cpan_mojo Mojolicious-Plugin-OAuth2-Server 0.08 by Lee Johnson - http://metacpan.org/release/LEEJO/Mojolicious-Plugin-OAuth2-Server-0.08
08:31 melo1 joined #mojo
08:50 trone joined #mojo
08:54 irq joined #mojo
08:58 rawler joined #mojo
08:58 rawler left #mojo
09:12 Ptolemarch joined #mojo
09:15 punter joined #mojo
09:31 meshl joined #mojo
09:42 meshl joined #mojo
09:43 fhelmber_ joined #mojo
09:56 batman oetiker: I do believe they are run in serial.
09:56 batman Not sure how you would do get+set+get+set if not
10:09 oetiker well you could trigger the set in the callback from the get ... but in order to not overwhelm the snmp agent, doing serial requests certainly makes sense ...
10:10 oetiker It was just not obvious from the documentation that it was like that and I wondered if I needed some extra logic to ensure it.
10:20 amon joined #mojo
10:24 jontaylor joined #mojo
10:51 ashimema_ joined #mojo
10:52 alnewkirk joined #mojo
10:57 punter Can I use perl 5.18 with the latest Mojolicious?
10:57 punter I'm asking because the website says: nd no requirements besides Perl 5.20.0 (versions as old as 5.10.1 can be used too, but may require additional CPAN modules to be installed)
10:57 punter will those modules get installed automatically, if needed?
10:58 punter Or: which modules should I install to make Mojolicious play with Perl 5.18?
10:59 go|dfish punter: if you have mojo installed. run 'mojo version' and it will list the OPTIONAL modules
11:00 pink_mist punter: most ways of installing should automagically install any needed module. how are you going about trying to install Mojolicious?
11:01 Ptolemarch joined #mojo
11:01 punter pink_mist, with cpanm
11:01 pink_mist punter: then stop worrying
11:01 punter ok, thanks! pink_mist
11:01 pink_mist anything that's needed will be installed automagically.
11:02 marmez pink_mist: 'automagically' :-)
11:02 pink_mist I love that word :P
11:03 mishantil It was in one of our compsci textbooks.
11:03 mishantil Fist place I saw it, way back in the day.
11:04 marmez pink_mist: Yes, that's awesome word
11:04 marmez I've seen it for the very first time here
11:06 marmez I'll use it now sure ;-)
11:06 pink_mist I also like "irrelephant" :P
11:06 marmez :-D
11:07 punter :)
11:38 dustinm joined #mojo
11:40 melo joined #mojo
12:44 neilhwatson joined #mojo
12:50 Ptolemarch joined #mojo
12:50 marmez joined #mojo
13:06 dparry joined #mojo
13:08 dparry Hi, I'm trying to use Mojo::IOLoop::Server and want to stop it and start it up again on a new port. If I do $server->stop and $server->reactor->stop then it seems to keep listening. So, I added a close $server->handle; which works fine except if I try and start up again on a previosuly used port I get: Can't open file descriptor 3: Bad file descriptor. Any ideas for correct way to do this please :) ?
14:06 sri Grinnz: what's the use case for dollar_only and ->do() ?
14:12 ignacio_ joined #mojo
14:15 asarch joined #mojo
14:27 gryphon joined #mojo
14:31 zivester joined #mojo
14:33 punter joined #mojo
14:37 sri anyway, do() not accepting proper placeholder values was an oversight
14:37 sri and is fixed now https://github.com/kraih/mojo-pg/commit/4e20fbd50286edd6a5d9d38f328d2a4b190084df
14:39 Ptolemarch joined #mojo
14:41 sivoais joined #mojo
14:48 sri i wonder if do() is even necessary though
14:48 sri you should be able to do everything with query()
14:50 sri and since there's no prepared statements there isn't really much overhead
14:54 sri guess do() gets deprecated ;p
15:00 jontaylor i must be behind on news, I never knew there mojo esque DB wrappers
15:00 jontaylor *there are
15:01 irq_ joined #mojo
15:03 Ptolemarch joined #mojo
15:05 sri and done ;p https://github.com/kraih/mojo-pg/commit/d930ef52a7a0fc4acf6a6886fa43f9ba870cd928
15:23 Grinnz sri, lol that works
15:24 Grinnz for dollar only and do, the use case would have been inserts or updates :P
15:25 Grinnz rather, updates that check json values or something
15:25 Grinnz jsonb*
15:36 disputin joined #mojo
15:40 sri nice, you can now test with postgres 9.4 on travis
15:42 sri gonna test jsonb now too
15:43 sri (with ->expand)
15:43 sri <3 postgres https://github.com/kraih/mojo-pg/commit/1b72c63e4a982016eb4e08ee7f7be07067bfab78#diff-6d8c1c9be729d3d174d06563b0376612R156
15:45 * Grinnz needs to come up with more reasons to use postgres
15:45 * sri is still considering the Mojo::Pg::PubSub idea
15:46 sri http://irclog.perlgeek.de/mojo/2015-02-08#i_10078436
15:46 sri (the json part does not wokr though, everything else does)
15:48 sh4 joined #mojo
15:51 btyler reading the postgres doc on NOTIFY, to me the really awesome sounding feature is adding a NOTIFY to a table change trigger
15:51 btyler would that fit into the api you floated earlier?
15:52 btyler or is that out of scope?
15:52 sri btyler: fits
15:52 sri Minion is actually doing just that :)
15:52 btyler oh snap :)
15:52 sri to notify workers of new jobs
15:53 sri https://github.com/kraih/minion/blob/master/lib/Minion/Backend/Pg.pm#L427
15:54 btyler ...nice.
15:55 sri it will get even better with postgres 9.5
15:55 sri SKIP LOCKED will make postgres a perfect fit for job queues
15:55 basiliscos joined #mojo
15:56 btyler a Mojo::Pg pubsub on table update makes me think of meteor, except with not-mongodb and not-javascript.
15:57 btyler also sane routing /me goes off on a meteor tangent
15:58 sri the current pubsub api is not bad either, but doesn't scale automatically https://github.com/kraih/mojo-pg/blob/master/lib/Mojo/Pg.pm#L140
15:59 sri the key is to use just one connection for pub/sub per worker process
15:59 btyler damnit sri, the software you write is so friggin packed with cool things that I can't just skim your docs like I do with everything else I use
16:00 btyler I had totally missed that pubsub was already in Mojo::Pg, and I've been hacking with it nightly for a few weeks now
16:00 sri :)
16:01 sri wonder if pgbouncer optimizes notifications
16:01 sri biggest scaling problem is that postgres is very bad at high concurrency
16:02 sri so you always aim for the lowest possible number of connections to the actual database
16:15 dparry I dunno if this is a bug but calling $server->stop() on Mojo::IOLoop::Server never seems to actually stop the server from listening...
16:24 mst it'll stop the loop, it won't necessarily close the socket if the object holding it is still around
16:24 mst er, hrm, maybe I'm wrong, but that's naively what I'd expect
16:31 dparry so I can do an explicit close mst like close $server->handle and that does get rid of the socket
16:32 dod joined #mojo
16:32 dparry but when I then later try and listen on that port again I get Can't open file descriptor 3: Bad file descriptor issues... hmmm
16:39 n2plato joined #mojo
16:40 dparry I guess i can just tolerate that as a known limitation :)
16:41 sri http://mojolicio.us/perldoc/Mojo/IOLoop/Server#start
16:41 sri it does exactly what the documentation says
16:42 sri and this exact behavior is a feature
16:43 mst being able to do 'stop, do some stuff, start again' does strike me as potentially useful
16:43 sri in fact, smooth restarting in morbo even depends on it
16:43 mst hence why I'd naively expect it to exist
16:43 mst dparry: it's only a limitation because you haven't needed the feature yet :)
16:45 sri i don't understand the problem actually, if you don't want the server anymore destroy it
16:46 mst right, surely if you're done with it, it should be going out of scope
16:54 ua_ joined #mojo
16:54 ua_ left #mojo
16:57 sri yay for accidental bugfixes \o/ https://github.com/kraih/mojo/commit/f3a06f398da02cc6c542a760e01827042da2c4bf#commitcomment-9720536
16:57 jberger it will go out of scope, and stop calling me shirley
17:00 jberger :-P
17:01 Grinnz_ circumventing IO::Poll ftw
17:01 Grinnz_ its funny that led to such better performance
17:11 cpan_mojo Mojo-Pg 1.08 by Sebastian Riedel - http://metacpan.org/release/SRI/Mojo-Pg-1.08
17:13 disputin joined #mojo
17:14 sri so much better performance, so much less code, so much less bugs
17:15 sri only downside really is that it's a private api
17:15 Grinnz_ right
17:16 Grinnz_ but a private API every other event loop is already using anyway :P
17:16 mst given there are other downstream consumers of it, at this point it's only theoretically private
17:16 sri yea, hopefully LeoNerd will get the module
17:17 n2plato joined #mojo
17:17 pink_mist and then it will be backed by Future :P
17:17 mst then he can change the API to intentionally break your usage ... no, wait, that was AE
17:17 Grinnz_ hahaha
17:17 sri lol
17:18 cpan_mojo Minion 1.07 by Sebastian Riedel - http://metacpan.org/release/SRI/Minion-1.07 (depends on Mojolicious)
17:18 sri i don't agree with LeoNerd on event loop apis, but he has done great things for Socket
17:18 mst I think if you're going to be strictly callback-based then ->defer is a *really* nice way to make it less unpleassant
17:18 mst but I really do enjoy having Future integrated all the way down
17:19 * sri hates Future especially
17:19 cpan_mojo Test-Mojo-Trim 0.0903 by CSSON - http://metacpan.org/release/CSSON/Test-Mojo-Trim-0.0903
17:19 bwf joined #mojo
17:19 sri due to its insistence on only wrapping other Future objects
17:20 sri not generic thenables
17:20 Grinnz_ maybe could be a feature request?
17:20 sri the wonderful thing about promises/a+ is that you can have multiple promises implementations cooperate
17:21 mst bear in mind that Future pre-dates that
17:24 mst sri: the thing is that Future supports the Q API, and apparently Q and Promises/A+ don't quite interop
17:24 sri right, a lot has happened since Q
17:25 mst "the wonderful thing about standards ..."
17:25 sri it's all about ES6 promises and bluebird now
17:26 sri gotta love the promises/a+ logo, straight to the point https://camo.githubusercontent.com/07541fd7901ef24e58f5f3d63e81b737869d5126/687474703a2f2f70726f6d6973657361706c75732e636f6d2f6173736574732f6c6f676f2d736d616c6c2e706e67
17:27 Grinnz_ lol
17:27 pink_mist hehe
17:31 tomboh joined #mojo
17:37 dparry sri / mst as far as I know the object does go out of scope but the socket listen is still held on to
17:37 sri that would be a bug
17:37 dparry I do a server->reactor->reset and leave the sub in which the server is created and then I reenter that sub and create a new server afresh
17:38 sri possible leak perhaps
17:38 dparry but unless I do an actual close then the netstat output still shows it listening
17:38 dparry but then I get the fd issues
17:38 sri do a Devel::Cycle::find_cycle($server)
17:39 sri (right before you let it go out of scope)
17:39 dparry ok
17:41 sri the thing about calling $server->stop is that it removes the listen socket from the event loop, so nothing should hold on to the server anymore and it should be possible to garbage collect it
17:41 Oleg joined #mojo
17:43 triamazikamno1 joined #mojo
17:43 sri it shouldn't even matter really
17:44 dparry http://pastebin.com/xnrmDNkr
17:44 sri i think you're just leaking
17:44 sri there you go
17:44 sri your accept event leaks
17:45 sri which prevent the server from being destroyed
17:45 sri *+s
17:45 dparry ah, I do a server->reactor->timer( 0 => sub { ... in there
17:46 dparry to spin off a sub to process the data just received
17:46 dparry guess that's a no no
17:46 pink_mist that's not a no no. the no no is what you're doing inside that sub probably
17:47 dparry http://pastebin.com/VCT35MGr is the accept
17:47 pink_mist you're using $server inside there
17:48 sri replace $carbon_serve with $server
17:48 sri unrelated, but ->timer(0 => sub {...}) is usually better written as ->next_tick(sub {...})
17:50 dparry ah, for the most part was renaming that just because perlcritic (>_<)
17:51 dparry that'll learn me to conform
17:51 sri some advice from perlcritic is dangerous
17:51 dparry Reused variable name in lexical scope: $server at line 75, column 13.  Invent unique variable names
17:51 dparry so I did... oops
17:52 sri it also still complains about "return undef;" i think
17:52 dparry yeah it does
17:53 dparry so now it looks much happier modulo Use of uninitialized value in delete at /usr/local/share/perl/5.18.2/Mojo/Reactor/Poll.pm line 84
17:53 sri don't get me wrong, a lot of what perlcritic says is right, but some of it is really dangerous advice
17:53 dparry which does not seem to prevent things from working
17:53 sri even damian now recommends "return undef;"
17:54 sri stop manually closing the socket
17:55 sri and learn to love Devel::Cycle
17:55 dparry awesome, gotta dash but thanks very much for your help once again!
18:01 mst ...
18:02 mst sri: aaand apparently Promises build_requires() AnyEvent
18:02 Grinnz_ wat
18:23 jberger any idea why I would get premature connection close when I use fork_call but only when the server is listening on ssl?
18:24 dotandimet joined #mojo
18:50 real joined #mojo
18:56 n2plato joined #mojo
18:56 dotandimet joined #mojo
19:05 elik joined #mojo
19:30 Ptolemarch joined #mojo
19:39 punter joined #mojo
19:43 jberger :o
19:43 jberger sri: I have a problem!
19:43 sri :o
19:43 jberger I don't THINK there are security concerns, but I'm going to query you just in case
19:50 sri event loops and fork is a can of worms i'd rather not open
19:51 sri forking in a running event loop is crazy when you think about it, there is sooooo much to go wrong
19:53 jberger $ioloop->reset was supposed to help that somewhat, and here its the problem
19:53 jberger :'(
19:54 sri you can't ever have a fool proof solution
19:55 sri just take epoll for example, by default parent and child would share the exact same epoll handle, and if you modify it in any way in the child the same modifications happen in the parent
19:56 sri kqueue is similar
19:56 ssm if you try to fool proof something, nature will just improve, and provide better fools
19:57 sri now your event loop backend may or may not know how to handle that
19:58 sri of course poll and select behave completely different
19:58 sri since they are not stateful
19:58 sri and that's just the most obvious problem i can think of
19:59 ua_ joined #mojo
19:59 ua_ left #mojo
19:59 jberger for a short-term fix, I can make an option which resets the ioloop, defaulting to 1
20:00 sri if you really want to track it down, replicate it outside of forkcall
20:01 jberger that might be possible
20:02 sri https://metacpan.org/pod/EV#FORK
20:04 jberger actually, I'm thinking of making a slightly breaking change
20:04 jberger the reset allow you to do event-loop features in the child
20:04 jberger I think that is a much more rare case
20:04 jberger that should be the optional behavior
20:06 sri you've not even mentioned which event loop and operating system you're using
20:06 jberger osx
20:06 jberger poll
20:06 sri new poll or old poll?
20:06 jberger and freebsd
20:06 jberger assuming poll
20:07 sri (new poll = 5.78)
20:07 jberger oh, let me try that
20:08 jberger no help
20:09 jberger for whatever reason ->reset seems to close connections that have already done an ssl handshake, but not ones that have not
20:09 dotandimet joined #mojo
20:09 sri Mojo::IOLoop::Server accepts with IO::Socket::IP
20:10 sri only the handshake is done with IO::Socket::SSL
20:10 sri with start_SSL (but that's unimportant)
20:11 sri it may very well be that IO::Socket::SSL has teardown logic that kills state across processes
20:11 sri i mean, who knows what Net::SSLeay really does
20:12 jberger true
20:12 jberger hmmmmmm
20:12 sri i'm no expert on how dup()-ing the descriptors on fork actually works in perl either
20:12 sri that's where i would look
20:13 jberger ah, that too
20:13 jberger egad
20:13 sri some cleanup code around IO::Socket::SSL
20:13 * jberger shoves purl down the stairs
20:13 * jberger pushes purl down the stairs
20:13 * purl attaches herself to jberger using suction and a ham straw
20:13 Grinnz_ egads
20:13 Grinnz_ ?
20:14 sri on the plus side, you seem to know that IO::Socket::IP handles work
20:14 sri so that might rule out perl quirks
20:14 jberger yeah, otherwise this would have happened before
20:15 sri https://github.com/noxxi/p5-io-socket-ssl/blob/master/lib/IO/Socket/SSL.pm#L1810-L1819
20:16 sri that's where i would start
20:17 jberger https://metacpan.org/pod/distribution/IO-Socket-SSL/lib/IO/Socket/SSL.pod#close
20:18 sri haha
20:20 sri that is really shitty
20:20 Grinnz_ lol
20:20 * jberger runs around failing wildly
20:22 Grinnz_ it does supposedly only call that if "CREATED_IN_THIS_THREAD"
20:22 Grinnz_ which is cleared by the CLONE method
20:22 sri that is threads only
20:22 Grinnz_ lol
20:23 sri that does seem like an IO::Socket::SSL fail
20:23 sri although, i'm not entirely sure about that
20:23 Grinnz_ it passes SSL_no_shutdown
20:23 sri but likely
20:23 Grinnz_ and _SSL_in_DESTROY whatever that does
20:24 jberger I would have to scan the open connections and stop_SSL(SSL_no_shutdown=>1) on any of them before calling restart
20:25 sri yea, that's stupid
20:25 jberger I don't disagree
20:25 sri especially since there's a check for threads
20:26 sri at the very least there should be some setting... "no_shutdown_after_fork => 1" or so
20:27 ua_ joined #mojo
20:28 jberger I guess I will have to file a bug/feature request there
20:29 n2plato joined #mojo
20:29 Grinnz_ yeah it wouldnt be hard... check if $$ has changed in DESTROY
20:30 Grinnz_ i suppose a little harder to make it check per-object :P
20:30 sri yea, like this https://github.com/kraih/mojo/blob/master/lib/Mojo/UserAgent.pm#L48
20:31 ua_ left #mojo
20:31 sri it's even easy to test with { local $$ = 23; ... }
20:35 n2plato joined #mojo
20:35 sri my $ssl = IO::Socket::SSL->new(...); my $dup = IO::Handle->new_from_fd(..., fileno $ssl);  { local $$ = 23; undef $ssl }; ok !$dup->closed;
20:35 sri something like that
20:35 purl hmmm... something like that is totally possible
20:37 jberger I even do something like that in fc already: https://github.com/jberger/Mojo-IOLoop-ForkCall/blob/master/lib/Mojo/IOLoop/ForkCall.pm#L87
20:38 sri i guess fork is different from threads because there are valid uses cases for a child inheriting a socket and becoming the sole owner
20:39 sri which is why i guess SSL_no_shutdown_after_fork => 1 would make sense
20:40 sri sadly that would require another change in mojolicious once it is available in IO::Socket::SSL
20:43 tgt joined #mojo
20:44 sri it would only just work for us if it defaulted to 1, but that seems unlikely
20:45 sri you might be able to argue with consistency (fork and threads)
20:45 mst oh, an InactiveDestroy equivalent
20:46 sri exactly
20:47 sri (for those wondering https://metacpan.org/pod/DBI#InactiveDestroy)
20:48 mst actually given the _after_fork bit I guess more http://p3rl.org/DBI#AutoInactiveDestroy
20:48 jberger interestingly, local *IO::Socket::SSL::DESTROY = sub {}; is not sufficient
20:49 jberger local *IO::Socket::SSL::close = sub {}; is however
20:50 sri yea, i'd say it's a deficiency in the IO::Socket::SSL api, DBI has solved it better
20:51 jberger agreed, but now I'm looking to see if ->reset explicitly calls ->close
20:51 jberger because if it was just DESTROY, shouldn't localizing that method fix it?
20:52 sri it is DESTROY
20:52 mst I -think- the close-on-out-of-scope might be a glob behaviour?
20:52 sri no wait
20:52 jberger Mojo::IOLoop::Stream::DESTROY
20:52 sri Mojo::IOLoop::Stream does close $handle;
20:53 Grinnz_ yeah i always set InactiveDestroy
20:53 Grinnz_ well, AutoInactiveDestroy
20:54 jberger yes, localizing DESTROY in both IO::Socket::SSL and in Mojo::IOLoop::Stream works
20:54 sri jberger: this doesn't make a difference, right? https://gist.github.com/anonymous/05ed9acbd82e9e874f67
20:55 sri (on its own)
20:55 jberger I can give it a try
20:55 cpan_mojo Test-Mojo-Trim 0.0904 by CSSON - http://metacpan.org/release/CSSON/Test-Mojo-Trim-0.0904
20:57 sri of course now i wonder if that "close $handle" is even necessary
20:58 jberger sorry, I need 5 minutes, $work has questions
20:59 sri all our tests pass without it
20:59 sri there's just a warning
20:59 sri from IO::Socket::SSL of course ;p
21:00 sri random warning it seems
21:00 Grinnz_ wouldn't this issue happen for a prefork server listening on ssl, when the workers exit?
21:01 sri nope
21:01 sri only workers accept connections
21:01 Grinnz_ ah
21:01 sri listen sockets are IO::Socket::IP when they are inherited
21:02 sri upgrade to IO::Socket::SSL happens after accept in the worker
21:02 Grinnz_ i see
21:03 sri grr, now i'm curious what that "close $handle" there actually does
21:06 sri aha, it goes back to this :O https://github.com/kraih/mojo/commit/4ca86357a458ad5ef42e52bb5f113cf3d1de33a0
21:07 jberger sri: your patch does fix it
21:07 sri lol
21:07 sri jberger: just removing close $handle does fix it too?
21:08 jberger I assume it would too
21:08 jberger as that is a superset of the same patch
21:09 sri hmm, there might actually be a memory leak
21:10 sri or maybe not
21:10 sri the starts with about 50mb and a concurrency of 100
21:11 sri ends up at 120mb, then jumps back down to 50mb afterwards
21:12 jberger it is possible that people depend on that behavior
21:12 jberger but I could argue that they shouldn't depend on it in forking code
21:12 sri no, we can do whatever we want there
21:13 sri i'm just worried about a memory leak now
21:13 jberger right, I'm saying leave the close in there, but with the pid check
21:13 jberger that seems very sane
21:13 sri that seems very dangerous
21:14 sri untested complicated behavior
21:14 sri i didn't even remember why the close $handle was there in the first place
21:15 basiliscos joined #mojo
21:16 sri for the record, memory use looks just the same on os x with the close and without
21:17 sri so i certainly can't see a "huge memory leak"
21:17 sri perhaps we should bump the IO::Socket::SSL verion just to be sure
21:19 good_news_everyon joined #mojo
21:19 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/N4xQ
21:19 good_news_everyon mojo/master 12a8239 Sebastian Riedel: no need to close the handle
21:19 good_news_everyon left #mojo
21:19 Ptolemarch joined #mojo
21:20 sri http://www.quickmeme.com/img/9d/9daf428b4fcdc94c27fae2bd28107198595f299cdf03cff8fcd124832d57322b.jpg
21:21 Grinnz_ lol
21:23 jberger hehehe
21:25 sri hmm, the IO::Socket::SSL version we require is a little bit old https://metacpan.org/changes/distribution/IO-Socket-SSL#L458
21:25 jberger I do still expect that we will hear complaints about that change
21:25 sri at least 2.0 seems like a good idea, considering it disables SSL 3.0
21:26 jberger I expect that people depend on $stream->close closing the handle
21:26 jberger that I agree with
21:26 cpan_mojo Mojolicious-Plugin-SemanticUI 0.12 by Krasimir Berov - http://metacpan.org/release/BEROV/Mojolicious-Plugin-SemanticUI-0.12
21:27 basiliscos joined #mojo
21:34 good_news_everyon joined #mojo
21:34 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/NBUk
21:34 good_news_everyon mojo/master 7035c8c Sebastian Riedel: IO::Socket::SSL 2.0 is much more secure
21:34 good_news_everyon left #mojo
21:36 jberger btw, recent commits do indeed fix fork_call+ssl
21:36 jberger \o/
21:36 sri little odd
21:37 jberger I still blame IO::Socket::SSL, that is weird
21:37 sri does it not shut down the TLS connection properly by default?
21:38 jberger not sure, I don't know enough about any of that
21:40 Ptolemarch joined #mojo
21:41 sri which version of IO::Socket::SSL does rhel ship these days?
21:46 Grinnz_ i'm trying ot check on my centos6 box, but the rpm's SSL.pm is missing
21:46 Grinnz_ :boggle:
21:47 Grinnz_ 1.31, apparently, lol
21:47 sri haha
21:48 sri looking throught the changelog... we really should be encouraging 2.0+
21:48 sri so many security changes
21:48 Grinnz_ 2.011 if you're planning to serve https
21:49 tgt 1.94 on CentOS 7 (according to http://centos-packages.com/7/package/perl-IO-Socket-SSL/)
21:49 Grinnz_ with the change they put in 2.011, i get an A from ssllabs
21:50 sri 2.011 seems a little bit too new
21:50 Grinnz_ yeah
21:51 sri 1.94 is missing all the big security changes
21:51 Grinnz_ lol
22:11 sri jberger, marcusr, batman, tempire: which version of IO::Socket::SSL you think we should require?
22:14 absolut_todd joined #mojo
22:17 jberger if it is just about security features on its side and not usage on our side, I don't know that it is our place to impose that restriction
22:17 jberger but I'm certainly not going to fight hard against bumping it either
22:19 Grinnz_ imo recommending in the docs that IO::Socket::SSL be kept up to date for security reasons is sufficient
22:19 Grinnz_ beyond that it's their fault
22:19 Vertig0 joined #mojo
22:20 firnsy can always encourage CentOS/RH to bump if you can find a potent enough CVE :)
22:20 jberger crab doesn't make the core ping list anymore :o
22:20 jberger he has even been around lately!
22:20 * jberger goes crab fishing
22:30 jberger you know, we could also warn on versions less than some level, sorta like we do for secrets
22:30 thowe joined #mojo
22:30 thowe I'm so happy.
22:30 thowe Ask me why I'm so happy.
22:30 thowe Go ahead....
22:30 thowe I'll wait...
22:31 thowe I guess I don't even know if anyone is awake in here...
22:32 pink_mist ... why are you so happy, thowe?
22:32 thowe because I got my ticket, plane tickets, and hotel all set up for YAPC::NA
22:32 thowe I'm actually going to go somewhere and do something
22:33 thowe which is rare for me
22:33 pink_mist oh nice =)
22:33 thowe =)
22:33 thowe I've never met another Perl person in person.
22:34 thowe It will be interesting
22:34 thowe I hope
22:34 jberger \o/
22:35 jberger I still need to submit a talk!
22:35 thowe Yes you do.  I would like to buy you a refreshing beverage.  though, I imagine you have most of your time spoken for.
22:36 thowe My "buy beer for" list is jberger, mst, and rjbs
22:36 thowe You guys have helped me a bunch.
22:36 jberger funny, that is my list too :-P
22:37 thowe We must have similar IRC schedules...
22:37 jberger I met both at YAPC::NA 2012, but I wasn't very well known then and it was more a quick handshake, now I would like to have a proper pint with any and all
22:38 thowe Oh.  Nobody knows me.  And there's no reason they should.
22:38 jberger and I should say, the reason that it was a quick handshake was not their fault
22:38 jberger rjbs especially was very friendly, but I wasn't sure what to say
22:38 jberger now I would have so much to talk about!
22:39 thowe And I will shut up and listen \o/
22:40 thowe I've even given myself extra time I think.  I'm arriving on the 7th and leaving the 11th.
22:42 thowe I saw some talk that rjbs gave online and that made me think "this is probably a friendly bunch.  I should go."
22:43 thowe The best part is that work is paying for it!  They kind of owe me one.
22:45 Grinnz_ nice
22:53 thowe Anyway.  Actually doing something other than going between work and home for once is nice for me.  I haven't done anything in a decade.
22:54 thowe whoa, there's shirts again?
23:00 sri jberger: TELL ME WHAT VERSION YOU WOULD PICK!
23:00 * sri shakes jberger
23:01 sri centos6 seems to be ancient, and Grinnz said centos7 is 1.94 or so
23:01 Grinnz_ i said centos6 is ancient, i havent tried 7 yet :P
23:01 sri 2.011 gives an A
23:01 sri 2.0 a B i believe
23:01 Grinnz_ yeah, because of the RC4 thing
23:02 sri ah right, tgt said it
23:02 Grinnz_ the RC4 thing is only important for running it as a server though, not for client TLS connections
23:04 sri looks like 1.94 is the version that would get the least complaints
23:04 sri but also be rather insecure
23:09 good_news_everyon joined #mojo
23:09 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/NBMi
23:09 good_news_everyon mojo/master f90ce74 Sebastian Riedel: aim a little lower
23:09 good_news_everyon left #mojo
23:10 sri oh, friday the 13th release \o/
23:10 Grinnz_ there, maybe :P
23:38 Vertig0 left #mojo
23:43 d4rkie joined #mojo

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