Camelia, the Perl 6 bug

IRC log for #mojo, 2010-08-22

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

All times shown according to UTC.

Time Nick Message
00:12 GitHub188 joined #mojo
00:12 GitHub188 mojo: master Sebastian Riedel * 5213103 (2 files in 2 dirs): fixed Mojo::Server::Daemon::Prefork not to prefork more workers than allowed - http://bit.ly/cgcdV2
00:12 GitHub188 left #mojo
01:36 [1]awnstudio joined #mojo
02:35 janus left #mojo
02:40 Alias joined #mojo
02:43 [1]awnstudio is now known as alnewkirk
02:48 janus joined #mojo
03:04 fod left #mojo
04:03 tholen42 joined #mojo
04:05 tl left #mojo
05:29 achromic left #mojo
05:36 achromic joined #mojo
06:03 alnewkirk left #mojo
07:03 perlrocks Twitter: "Mojo + DBIx:: Skinny + Test:: mysqld such that - perl http://htn.to/2e1ihB study notes" (ja) --ItSANgo http://twitter.com/ItSANgo/status/21811853644
07:03 perlrocks Twitter: "RT @ ItSANgo: Mojo + DBIx:: Skinny + Test:: mysqld こと はじめ - perl 勉強 メモ http://htn.to/2e1ihB" (id) --AE_PerlIsm http://twitter.com/AE_PerlIsm/status/21811853897
07:49 tab joined #mojo
07:49 tab hi, what is the best way to get the remote ip address of the client using my Mojolicious application?
07:50 tab currently I´m using the prefork daemon together with nginx, where $ENV{REMOTE_ADDR} doesn´t work
07:51 dotan joined #mojo
07:55 esskar left #mojo
07:57 esskar joined #mojo
08:10 dotan left #mojo
08:17 tab left #mojo
08:22 [1]awnstudio joined #mojo
09:26 yko joined #mojo
09:31 [1]awnstudio left #mojo
09:31 [2]awnstudio joined #mojo
10:24 GitHub3 joined #mojo
10:24 GitHub3 mojo: master Sebastian Riedel * 48cade6 (2 files in 1 dirs): added --reverseproxy option to daemon and daemon_prefork - http://bit.ly/8Yri9y
10:24 GitHub3 left #mojo
11:10 perlrocks Twitter: "Wow! Mojo::DOM is awesome! Is there something similar outside of Mojolicious? #lazyweb #perl" --rainboxx http://twitter.com/rainboxx/status/21822563080
11:27 perlrocks Twitter: "This dependency list is awesome: http://rb.ly/2561 - #Mojolicious is powerful without many dependencies! #perl" --rainboxx http://twitter.com/rainboxx/status/21823291906
11:32 perlrocks Twitter: "How to get the title of a website?
11:32 sri Oo
11:40 perlrocks Twitter: "@kraih Wow! Mojo::DOM is awesome! Is there something similar outside of Mojolicious? perl... http://bit.ly/boG12k" --KathlynQ http://twitter.com/KathlynQ/status/21823861965
11:44 sri yay the spambots like mojolicious -.-
12:06 [2]awnstudio left #mojo
12:28 dotan joined #mojo
12:36 perlrocks Twitter: "@sharifulin Wow! Mojo::DOM is awesome! Is there something similar outside of Mojolicious? perl... http://bit.ly/boG12k" --RobWheatly http://twitter.com/RobWheatly/status/21826577025
12:36 sri damn bots
12:46 perlrocks Twitter: "@rainboxx HTML::Selector::XPath, HTML::Query, see here for more: http://corky.net/dotan/?p=2340 #mojolicious #perl" --dotandimet http://twitter.com/dotandimet/status/21827096853
12:46 tab joined #mojo
12:51 perlrocks Twitter: "@pfischermx Wow! Mojo::DOM is awesome! Is there something similar outside of Mojolicious? perl... http://bit.ly/boG12k" --RobWheatly http://twitter.com/RobWheatly/status/21827358935
12:52 dotan Ugh. It's a "service" which spams twitter from twitter.
13:01 tab left #mojo
13:06 perlrocks Twitter: "@memowe Wow! Mojo::DOM is awesome! Is there something similar outside of Mojolicious? perl... http://bit.ly/boG12k" --RobWheatly http://twitter.com/RobWheatly/status/21828192427
13:21 perlrocks Twitter: "@sukria Wow! Mojo::DOM is awesome! Is there something similar outside of Mojolicious? perl... http://bit.ly/boG12k" --RobWheatly http://twitter.com/RobWheatly/status/21829055548
14:01 GitHub100 joined #mojo
14:01 GitHub100 mojo: master Sebastian Riedel * 4936d7a (3 files in 2 dirs): pod update - http://bit.ly/b0YN1Y
14:01 GitHub100 left #mojo
14:13 sri muhahaha, mojolicious spam for sukria, thats hilarious
14:19 perlrocks Twitter: "@ RobWheatly It definitely is. The only thing I know is # jQuery, but I'm happy to have it inside of # Mojolicious. :) # # Mojodom awesome" (de) --memowe http://twitter.com/memowe/status/21832753901
14:20 sri !tweet @memowe don't feed the spambots! :p
14:20 perlrocks sri: http://twitter.com/perlrocks/status/21832833421
15:08 GitHub123 joined #mojo
15:08 GitHub123 mojo: master Sebastian Riedel * 8c21cb1 (2 files in 2 dirs): pod update - http://bit.ly/9x39ta
15:08 GitHub123 left #mojo
15:18 vel joined #mojo
15:18 skaurus joined #mojo
15:18 skaurus hi all!
15:19 * sri waves
15:19 skaurus trying to start Mojo in fastcgi mode with socket:
15:19 skaurus script/birdy fastcgi --listen file:///tmp/birdy.sock
15:19 skaurus and receiving: Can't accept FastCGI connection: Socket operation on non-socket
15:20 skaurus ls -Fla /tmp/birdy.sock: srwxrwxrwx 1 root root 0 Aug 22 11:07 /tmp/birdy.sock=
15:20 skaurus daemon mode with this socket seems to start
15:20 sri the native fastcgi binding doesn't support listening on sockets
15:21 sri it requires and external proc manager
15:21 sri spawn-fcgi is the most popular i think
15:22 skaurus ok thanks, i google it. Sorry for stupid questions ;)
15:22 sri you can always get a list of all available options for a command with "mojolicious help $command"
15:23 sri in the case of fastcgi, there are no options :)
15:25 sri or you could use PSGI, there is a cookbook recipe
15:25 sri "% plackup ./script/myapp -s FCGI -l /tmp/myapp.sock"
15:26 sri from what i heard spawn-fcgi is more fun though
15:26 skaurus oh, i google it too. Even dont now how PSGI works :) thank you!
15:28 skaurus s/now/know/
15:29 skaurus damn, s/PSGI/FCGI/ ...
15:30 sri the cookbook lists quite a few deployment options, my favorite is the prefork daemon behind a nginx reverse proxy
15:31 skaurus yes, my nginx conf taken from cookbook) daemon_prefork will be the fastest choice?
15:32 sri depends what your app does
15:32 sri what does it do?
15:33 skaurus errm, common staff - template rendering, talking to the database, ajax...
15:34 skaurus maybe file streaming
15:34 sri generally as soon as you talk to a database web server performance becomes irrelevant :)
15:34 skaurus maybe long-polling
15:35 skaurus but anyway :) what will be the fastest choice for frontend? :)
15:35 sri depends entirely on your benchmark ;p
15:36 skaurus so why all questions about my app then?)
15:36 sri for mojolicious hello world micro benchmarks most servers are within 5-10% of one another
15:37 sri files will benefit a lot by reverse proxy caching
15:37 skaurus okay, you prefer daemon_prefork, i pick that :)
15:37 skaurus nginx will be there anyway
15:37 sri daemon_prefork and Starman have been the winners in my tests
15:39 sri skaurus: how many req/s does your app do without server (shown in debug logs)?
15:40 vel left #mojo
15:42 skaurus I'm just starting ))
15:42 sri i know... it depends on what the individual action does... but in my micro benchmarks the break even point for server and app was about 500 req/s
15:42 sri the possibility for you to reach that while talking to a database is pretty much non existing :)
15:43 sri so you are free to pick whatever you like most
15:43 skaurus free cpu time is always useful :)
15:44 sri overrated
15:44 sri free memory is always worth more
15:44 skaurus for me this fails without errors: script/birdy daemon_prefork --listen file:///tmp/birdy.sock -pid /tmp/birdy.pid --lock /tmp/birdy.lock  --daemonize
15:44 skaurus agreed
15:44 sri and what use is a fast server it it's unstable :)
15:45 sri don't daemonize right away
15:45 sri messages might be in the log file
15:45 sri *if
15:45 skaurus okay, good point, so from a perspective of a stability and memory what will be best choice? )
15:45 skaurus no messages
15:47 skaurus running from root. May this be the cause?
15:47 skaurus oh, i missed message about daemonize
15:47 sri which mojo version?
15:51 sri there have been pretty much no problems with the prefork daemon in months now, i consider it very stable
15:51 fod joined #mojo
15:51 sri oh btw. if you want long polling fastcgi is a bad idea
15:52 skaurus I just dont seen errors because of daemonise, so all is fine...
15:52 sri most servers cache all output
15:52 fod_ joined #mojo
15:53 sri for long polling you should really try the latest github version, it's a lot of fun there :)
15:54 sri (which can also be seen in my recent tweets)
15:55 sri oh, i wrote you on twitter already -.-
15:55 skaurus yes, i'm running the latest :)
15:56 fod__ joined #mojo
15:58 fod__ left #mojo
16:01 skaurus it's works!)
16:01 perlrocks Twitter: "Please test the latest #mojolicious changes on github, would like to have some of the fixes on cpan as soon as possible. :) #perl" --kraih http://twitter.com/kraih/status/21840024405
16:02 sri :)
16:08 skaurus if $self->render(message => 'Welcome to the Mojolicious Web Framework!'); in generated code means direct output to browser, then it should be rewrited with $self->render(text => 'Welcome to the Mojolicious Web Framework!');
16:14 dotan does mojolicious write a log file by default when run as Fastcgi? Does it try to create it under $Findbin::bin/log or similar?
16:16 dotan OOh! It writes to the Apache log, of course!
16:21 perlrocks Twitter: "@ Kraih btw: is there a mojolicious wiki software already somewhere?" (de) --discordianfish http://twitter.com/discord​ianfish/status/21841413022
16:22 maettu joined #mojo
16:25 skaurus 1. default generated app (not lite) dont routing requests like /controller/method/2 to Example.pm (use App::Example in App.pm maybe?)
16:26 skaurus 2. daemon_prefork seems to ignore kill -s USR1 `cat /tmp/app.pid` ...
16:42 sri !tweet @discordianfish i think @marcusramberg wanted to write a wiki with #mojolicious.
16:42 perlrocks sri: http://twitter.com/perlrocks/status/21842753369
16:42 perlrocks Twitter: "@discordianfish i think @marcusramberg wanted to write a wiki with #mojolicious. --sri" --perlrocks http://twitter.com/perlrocks/status/21842753369
16:43 sri skaurus: message is just a message passed to a template
16:43 dotan !tweet @discordianfish http://github.com/shoorick/mojowka #mojolicious #wiki
16:43 perlrocks Twitter: "@discordianfish http://github.com/shoorick/mojowka #mojolicious #wiki --dotan" --perlrocks http://twitter.com/perlrocks/status/21842858254
16:43 perlrocks dotan: http://twitter.com/perlrocks/status/21842858254
16:43 skaurus i got it, but request still don't routing...
16:44 sri skaurus: i'm quite sure the example app works just fine, you might want to read the mojolicious guides and tutorial
16:45 skaurus i dont even change it
16:45 skaurus ok, i dig it
16:47 sri http://127.0.0.1:3000/example/welcome/23 # works absolutely flawless
16:52 skaurus it works with welcome and don't work with for example somemethod
16:53 sri it does if that method exists
16:53 skaurus I thought :method means that any word in route goes to actuval stash var method
16:53 sri no
16:53 skaurus *actual
16:53 sri it's all described in the guides
16:54 sri controller and action are special
16:57 skaurus so it working like this: route will be recognized only if controller equal to example and method equal to welcome
16:57 skaurus in docs i see:     # /           -> {controller => 'foo',   action => 'bar'}
16:57 skaurus # /users      -> {controller => 'users', action => 'bar'}
16:57 skaurus # /users/list -> {controller => 'users', action => 'list'}
16:57 skaurus $r->route('/:controller/:action')
16:57 skaurus ->to(controller => 'foo', action => 'bar');
16:58 skaurus i thought comments described how different urls will be dispatched to different controllers and methods
17:01 skaurus but in reality this route recognize nothing from there urls
17:02 yko sri: can i make work layouts and template inheritance togather?
17:02 yko something like this http://gist.github.com/543985
17:03 yko i think i understand 'extends' wrong
17:03 sri skaurus: you are misunderstanding something
17:04 sri yko: you do
17:05 sri yko: extends *is* layout without the layouts/ prefix :)
17:06 yko that example doesn't work as i expected :\ i'm expection <body><div id='wrapper'>Yea baby!</div></body>
17:06 sri skaurus: /:controller/:action means exactly that you can dispatch wild to all combinations of classes and methods
17:06 sri btw. USR1 is really broken, fixing right now
17:07 sri and improving it a little while i'm at it
17:08 yko Oh... i forgot, that i can not override content block if it already defined
17:09 sri thats the essence of inheritance, the first wins
17:11 skaurus sri: okay, i think i expected error message if i don't have such combination of controller and method, even if error log
17:12 skaurus sri: but now, why i have route $r->route('/:controller/:action/:id') and it don't work with url '/example/method/3', if i have controller Example and sub 'method' inside it?
17:12 skaurus *even if in
17:12 sri i'm sure it does work, maybe you forgot to render something?
17:12 skaurus sri: i don't have template 'method'!
17:13 sri template or text, whatever
17:13 sri it always defaults to 404
17:13 yko sri: http://gist.github.com/544011
17:13 yko Don't you think such behavior would be usefull?
17:13 skaurus and message about unexistent template is in error log, so all fine here
17:14 dotan left #mojo
17:14 sri yko: what behavior are you refering to?
17:15 GitHub188 joined #mojo
17:15 GitHub188 mojo: master Sebastian Riedel * 2b3675e (3 files in 3 dirs): fixed graceful shutdown support in Mojo::Server::Daemon::Prefork - http://bit.ly/9la7Iq
17:15 GitHub188 left #mojo
17:17 sri yko: i think you should use named content blocks
17:18 yko sri yes, now i'm getting idea of 'extends'
17:18 sri i'm still looking for easier examples to explain extends right :/
17:19 yko well, it's not so obviously and easy to udnerstand :(
17:19 skaurus sri: about USR1... not i'm killing processes, erase sock file, start app again... and each time i must do chmod a+w on sock file - nginx complain about permission denied. It will be fixed too after fixing of USR1?
17:19 sri django and rails both use pretty much the same
17:19 skaurus sri: s/not/now/
17:19 sri skaurus: why do you erase the sock file?
17:20 sri you should start the new prefork daemon *before* shutting down the first
17:20 skaurus sri: because if i don't do that app complain on start: Can't create listen socket: Address already in use
17:20 sri the new one can just take over because they share the same lock file
17:21 sri hmm
17:21 skaurus for now it's simpler to me to just kill and start new...
17:21 skaurus Can't create listen socket: Address already in use at /usr/lib/perl5/site_perl/5​.8.8/Mojo/Server/Daemon.pm line 342
17:22 skaurus sri: can't we create 0777 sock file?
17:30 yko sri: http://gist.github.com/544026 -- that's how i dream about 'extends'
17:31 sri this bug sits a bit deeper, i'll investigate
17:39 skaurus sri: Sebastien, i'm looking into commit http://bit.ly/9la7Iq and see only added logging
17:39 skaurus sri: am i blind or it work in progress?
17:40 sri ?
17:40 sri graceful shutdown is fixed
17:41 skaurus but in commit only changes is $self->app->log->info('Graceful shutdown.') !
17:41 sri no it's not
17:41 sri open your eyes, the code moved :)
17:41 skaurus ah! )
17:41 skaurus sorry)
17:45 skaurus sri: what about creating sockets with 777 permission?
17:45 sri thats not the right fix
17:45 sri working on it
17:46 sri 777 is a very bad idea though
17:46 skaurus ok, thank you :)
18:03 sri hmm, wonder if i should implement hot deployment for tcp sockets too while i'm at it
18:04 sri it would require config files
18:07 Htbaa joined #mojo
18:19 MojoGuest646 joined #mojo
18:19 MojoGuest646 From: http://www.google.com/search?hl=en&amp;clien​t=firefox-a&amp;hs=y9u&amp;rls=org.mozilla%3​Aen-US%3Aofficial&amp;q=html5+irc&amp;aq=f&a​mp;aqi=g-c3&amp;aql=&amp;oq=&amp;gs_rfai= (1 hits)
18:19 yko hi MojoGuest646
18:19 yko it works :)
18:19 MojoGuest420 joined #mojo
18:19 MojoGuest420 From: http://news.ycombinator.com/item?id=1277067 (34 hits)
18:20 MojoGuest420 left #mojo
18:20 MojoGuest646 left #mojo
18:20 yko hm
18:27 perlrocks Twitter: "RT @kraih Please test the latest #mojolicious changes on github, would like to have some of the fixes on cpan as soon as possible. :) #perl" --zakame http://twitter.com/zakame/status/21849121231
18:51 sri yea, i'm going with a pure perl config file and nginx like restart
18:51 sri no more command line options for daemon_prefork though
18:53 sri it's going to be a pure workhorse
18:54 marcus winnuke
19:03 * marcus streams all over yko
19:05 * yko pretends that he does not understand english.
19:31 Htbaa left #mojo
19:53 sri oh this is fun :D
19:55 skaurus seriously? :)
19:59 sri YA RLY!
20:00 sri not sure yet how to do config reloading at runtime, but i'm sure i'll find a solution :)
20:21 sri or actually, i won't do that
20:23 skaurus sri: i can't get how to add custom renderer. All examples either not complete either about Mojolicious::Lite. Here what i have in main package: http://pastie.org/1108418 It should output string 'The rendered result!' i think. Also i added welcome.html.tt template in templates/example dir and moved ep template to ep1. It doesn't work... In logs i see messages about unknown type ep1 and nothing about tt.
20:23 skaurus sri: why you won't do that?)
20:24 sri skaurus: just use one from cpan
20:24 skaurus I'd prefer to minimize use of foreign code... This task should be quite simple to do, isn't?
20:25 skaurus warns in included code doesn't logged too...
20:25 sri custom renderer is advanced stuff
20:25 skaurus oookay...
20:27 sri if you really want one look at existing renderers, i'm sure there is a minimal dummy one in the tests too
20:27 skaurus sri: "Maybe you would prefer a different template system than ep, all you have to do is add a new handler" ;)
20:31 marcus "Just get one from CPAN"...
20:31 marcus :p
20:31 skaurus ))
20:32 sri if you want to start out doing advanced stuff just go ahead, who am i to keep you from shooting yourself in the foot :)
20:32 sri there is a perfectly working recipe in the same guide
20:33 sri in the advanced section
20:33 sri just saying it's a good idea to get to know the framework first before extending it
20:35 yko and shoot other people in the foot before try it on yourself...
20:44 skaurus and i'm just tried to adapt one of that examples from mojolicious::lite to simple mojolicious...
20:45 skaurus it's a pain that nearly all simple examples available only for lite...
20:45 sri mojolicious::lite is the simple one, mojolicious is a monstrous catalyst killer :)
20:46 skaurus with evil voice: mwahahaha :)
20:46 sri you are supposed to learn lite first
20:46 sri work through the tutorial and stuff
20:47 sri and slowly grok how lite and normal mojolicious are connected
20:48 skaurus unlucky me...
20:48 sri they are very very similar once you get that :)
20:49 sri right now you are taking pretty much the hardest route possible ;p
20:55 cristi8 left #mojo
21:01 dotan joined #mojo
21:06 Htbaa joined #mojo
21:08 yko left #mojo
21:09 tab joined #mojo
21:16 tab hi, what is the best way to get the remote ip address of the client using my Mojolicious application?
21:16 tab currently I´m using the prefork daemon together with nginx, where $ENV{REMOTE_ADDR} doesn´t work
21:17 sri don't use %ENV in mojolicious
21:18 sri $self->tx->remote_address;
21:18 skaurus proxy_set_header X-Forwarded-for $remote_addr; ?
21:18 sri you might have to enable MOJO_REVERSE_PROXY=1
21:19 sri depends if nginx is on the same server
21:19 skaurus sri: and it will work behind nginx? wow)
21:20 maettu left #mojo
21:20 sri it of course depends on X-Forwarded-For
21:22 dotan left #mojo
21:22 tab nginx is on the same server
21:30 tab now $self->tx->remote_address returns 127.0.0.1  :-(
21:30 tab but MOJO_REVERSE_PROXY is set to 1
21:32 fod_ left #mojo
21:35 sri then X-Forwarded-For is missing
21:35 tab now it works
21:36 tab i added this x-forwarded in nginx config
21:36 tab thanks!
21:36 tab this is a really helpful channel here :-)
22:07 skaurus oh shit. I though Mojolicious take all available template renderers, sorted them in some way and then tries to find template in on of these formats
22:07 skaurus i was wrong?
22:08 skaurus i make mistakes in my English, sorry, i'm sleepy )
22:08 tab left #mojo
22:10 Htbaa left #mojo
22:33 sri skaurus: thats exactly what it does
22:34 sri and the guides explain exactly how it works
22:34 ltriant joined #mojo
22:34 sri Zzz
22:52 skaurus sri: doesn't work for me unless i explicitly set default handler tt
22:55 skaurus to be exact, it doesn't work if i have, say, 'tt' and 'ep1' templates, second is obviously don't handled by any renderer. (Tried to get rid of default template by renaming it). In that case nothing rendered, i expected it will render tt
22:56 skaurus lets call it feature request :)
23:36 MojoGuest443 joined #mojo
23:36 MojoGuest443 test
23:37 MojoGuest443 left #mojo
23:38 MojoGuest546 joined #mojo
23:39 MojoGuest546 left #mojo

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