Time |
Nick |
Message |
00:16 |
|
jamesw joined #mojo |
00:23 |
|
btyler joined #mojo |
01:03 |
|
laouji joined #mojo |
01:12 |
|
yakudza joined #mojo |
01:17 |
|
basic6 joined #mojo |
01:33 |
|
btyler joined #mojo |
02:00 |
|
asarch joined #mojo |
03:14 |
|
al joined #mojo |
03:33 |
|
preflex_ joined #mojo |
04:31 |
|
btyler joined #mojo |
04:39 |
|
laouji_ joined #mojo |
04:40 |
|
laouji joined #mojo |
04:45 |
|
laouji_ joined #mojo |
05:17 |
|
dqw joined #mojo |
05:25 |
|
dotandimet joined #mojo |
05:53 |
|
KindOne joined #mojo |
06:38 |
|
dqw joined #mojo |
06:55 |
|
Vandal joined #mojo |
07:02 |
|
d4rkie joined #mojo |
07:03 |
|
D4RK-PH0ENiX joined #mojo |
07:25 |
|
arpadszasz joined #mojo |
07:31 |
|
batman joined #mojo |
07:35 |
|
d4rkie joined #mojo |
07:56 |
|
heytrav joined #mojo |
07:56 |
|
dod joined #mojo |
07:57 |
|
rem_lex|pivo joined #mojo |
07:59 |
batman |
sri: https://gist.github.com/jhthorsen/a7d6f392370f1b4df6aa # is that by design that the config plugin points back to the app? |
08:01 |
|
dod joined #mojo |
08:07 |
batman |
it works like a charm if i remove the Mojolicious::Plugin::Config::Sandbox::app() sub |
08:07 |
batman |
maybe the solution would be to simply weaken $app before letting the app() method hold on to it? |
08:08 |
* batman |
tries it out |
08:08 |
|
marcus joined #mojo |
08:09 |
batman |
right. adding weaken seems to do the trick... |
08:09 |
* batman |
writes a test |
08:09 |
marcus |
O/ |
08:20 |
|
KindOne joined #mojo |
08:21 |
batman |
https://github.com/jhthorsen/mojo/commit/c69f29d104d40105a395d6052d0acf39ca9ae9e3 # really not sure how this works... |
08:21 |
batman |
do i simply send a pull request? |
08:23 |
batman |
i'm thinking maybe the app function could be removed from the ::Sandbox namespace after the config has been read |
08:23 |
batman |
might be cleaner |
08:31 |
|
Vandal joined #mojo |
08:44 |
|
wsri joined #mojo |
08:44 |
|
marcus joined #mojo |
08:45 |
|
batman joined #mojo |
08:55 |
|
basiliscos joined #mojo |
09:30 |
|
sh4 joined #mojo |
09:43 |
|
__mkrull left #mojo |
10:01 |
|
rem_lex| joined #mojo |
10:12 |
|
hummeleBop joined #mojo |
10:51 |
|
dqw joined #mojo |
10:58 |
|
ryozi joined #mojo |
10:59 |
|
dqw2 joined #mojo |
11:00 |
|
ryozi__ joined #mojo |
11:05 |
|
dotandimet joined #mojo |
11:20 |
batman |
is it possible that websockets leak like there's no tomorrow? |
11:20 |
batman |
i can't see that my controller (where the websocket lives) ever gets DESTROY called |
11:21 |
batman |
except during global destruction... |
11:22 |
BinGOs |
use Ragnarök; |
11:23 |
batman |
https://gist.github.com/jhthorsen/7899ef135f942261a928 <-- not the most complex code either... |
11:23 |
batman |
BinGOs: what's that? |
11:23 |
BinGOs |
"like there's no tomorrow" |
11:23 |
batman |
:D |
11:24 |
BinGOs |
granted I had to google "Norse end of the world" to get that |
11:25 |
BinGOs |
the first rule of socket leak club is the first rule of socket leak club is the first rule of socket leak club is ... |
11:25 |
batman |
right... i wish it was some super-duper-memory-tracking-system ;) |
11:25 |
batman |
haha |
11:31 |
|
denisboyun joined #mojo |
11:37 |
batman |
https://github.com/jhthorsen/mojo/commit/53177ea331bb66a7ca085bb53a6420ff4dc325b8 |
11:37 |
batman |
the last test fail ^ |
11:48 |
batman |
marcus: http://www.osloby.no/sulten/Ol_-ol-og-mere-ol-7293833.html |
11:52 |
|
KindTwo joined #mojo |
11:58 |
|
maxhq joined #mojo |
11:58 |
|
KindTwo joined #mojo |
12:16 |
|
KindTwo joined #mojo |
12:17 |
|
arpadszasz joined #mojo |
12:25 |
|
KindTwo joined #mojo |
12:28 |
|
punter joined #mojo |
12:29 |
|
mire joined #mojo |
12:31 |
punter |
sri: Mojo::Transaction::WebSocket has an unsubscribe method, yet it's not mentioned in https://metacpan.org/module/Mojo::Transaction::WebSocket with its own section like all other methods are (neither is it mentioned in its parent class's documentation either) |
12:32 |
punter |
I'll file a bug report |
12:32 |
batman |
punter: it's mentioned on the super-super-class: https://metacpan.org/module/Mojo::EventEmitter |
12:32 |
punter |
a ok! |
12:32 |
punter |
thanks! :-) |
12:34 |
|
bowtie_ joined #mojo |
12:40 |
punter |
So... my experiments show that in a websocket server, $controller->tx becomes 'undef' if the connection closes |
12:43 |
punter |
And conversely, if $controller->tx is undef, then the websocket connection is finished already (no need to finish it again) |
12:46 |
|
dod joined #mojo |
12:58 |
sri |
batman: how is app being stored in the snadbox namespace a problem again? |
13:04 |
sri |
anyway, there's more modules that do the same |
13:32 |
|
asarch joined #mojo |
13:38 |
|
mire joined #mojo |
13:45 |
|
mire_ joined #mojo |
13:47 |
|
arpadszasz joined #mojo |
13:53 |
|
gryphon joined #mojo |
13:59 |
|
btyler joined #mojo |
14:05 |
sri |
batman: i can confirm the websocket leak though, it's a pretty bad leak |
14:06 |
sri |
and affects all events registered in full apps |
14:14 |
|
good_news_everyone joined #mojo |
14:14 |
good_news_everyone |
[mojo] kraih pushed 1 new commit to master: http://git.io/rHTkfQ |
14:14 |
good_news_everyone |
mojo/master e3245e4 Sebastian Riedel: fixed memory leak in Mojolicious::Routes |
14:14 |
|
good_news_everyone left #mojo |
14:31 |
|
dqw joined #mojo |
14:55 |
|
dod joined #mojo |
15:23 |
sri |
batman: the description doesn't make much sense either, i don't see a circular reference |
15:30 |
|
arpadszasz joined #mojo |
15:42 |
|
good_news_everyone joined #mojo |
15:42 |
good_news_everyone |
[mojo] kraih pushed 1 new commit to master: http://git.io/iKB9Kw |
15:42 |
good_news_everyone |
mojo/master 876e7d3 Sebastian Riedel: test long polling in full application |
15:42 |
|
good_news_everyone left #mojo |
15:47 |
|
loy joined #mojo |
15:48 |
|
henq joined #mojo |
15:50 |
|
denisboyun joined #mojo |
16:07 |
|
good_news_everyone joined #mojo |
16:07 |
good_news_everyone |
[mojo] kraih pushed 1 new commit to master: http://git.io/Xjwitg |
16:07 |
good_news_everyone |
mojo/master 18791fd Sebastian Riedel: added tests for custom default controller class |
16:07 |
|
good_news_everyone left #mojo |
16:08 |
sri |
these things are so easy to test now |
16:08 |
* sri |
still remembers how hard it used to be when he wrote the original long polling tests |
16:26 |
|
d4rkie joined #mojo |
16:39 |
|
denisboyun joined #mojo |
16:47 |
batman |
sri: thanks for looking on the tests! |
16:47 |
batman |
sri: about the Sandbox::app(): yeah, the description is awful. sorry about that :/ |
16:48 |
|
stan_theman left #mojo |
16:48 |
|
d4rkie joined #mojo |
16:48 |
|
arpadszasz joined #mojo |
16:49 |
batman |
but i don't see why it's a good idea to store the $app in a closure like that. it can never go out of scope..? |
16:50 |
batman |
what is the argument toward keeping it that way? |
16:51 |
sri |
batman: what is the argument towards changing it? |
16:51 |
batman |
making sure the $app goes out of scope and cleans up what it holds |
16:51 |
sri |
but why? |
16:52 |
batman |
because it will make my check-for-memory-leak-unit-testing smoother :/ |
16:52 |
sri |
i don't follow |
16:53 |
batman |
if not, i will have to continue doing what i do now: remove the function after the config plugin is loaded... |
16:53 |
|
dvinciguerra_ joined #mojo |
16:53 |
batman |
i'm trying to track all the objects that is created and then see if they are still around at the end of my unittest. |
16:53 |
batman |
i got some really bad leaks which i try to avoid... |
16:54 |
sri |
lite apps are stored in globals all over the place, i don't see the gain here |
16:54 |
batman |
but because of the config plugin, i had to spend some time figuring out what actually was kept around and not |
16:54 |
sri |
if you want change you need to make things actually better, not just different |
16:55 |
batman |
ok. |
16:55 |
batman |
i don't really have any killing arguments, so i'm going to leave it. |
16:55 |
batman |
what's important is to make sure the ws request doesn't leak. |
16:56 |
sri |
had you tracked down all instances of apps being kept in globals and done something with them... we could talk... but right now it seems pointless |
16:57 |
batman |
okidoki |
16:58 |
batman |
the step you have taken now, is adding failing tests? |
16:58 |
sri |
? |
16:58 |
batman |
sorry. i skipped the subject :( |
16:58 |
batman |
talking about the two commits good_news_everyone posted |
16:58 |
batman |
still looking for the actual leakage, or..? |
16:59 |
sri |
i'm testing things that didn't work because of the leak |
16:59 |
batman |
ok. |
16:59 |
sri |
and added tests to prevent other things from leaking |
16:59 |
batman |
do you think i can do anything to help? |
16:59 |
sri |
it's done |
17:00 |
sri |
fixed |
17:00 |
batman |
sri++ # that's awesomelicious! :) |
17:00 |
sri |
was a pretty bad leak though, all events in full apps were leaking |
17:00 |
batman |
has it always been like that? |
17:00 |
sri |
possibly |
17:01 |
sri |
Mojolicious::Routes creates new controller instances without weakening them, which Mojolicious does for the default controller |
17:01 |
batman |
yeah. i saw the commit now... |
17:01 |
sri |
so lite apps didn't leak, just full ones, because of the new controllers |
17:02 |
batman |
i don't get that, but i'm not sure if you should even consider trying to make me understand ;) |
17:02 |
batman |
s/but/and/ |
17:02 |
|
dqw joined #mojo |
17:03 |
batman |
when is the new version on cpan? |
17:03 |
sri |
it's actually a much simpler topic than globals holding on to app instances ;p |
17:04 |
batman |
haha |
17:05 |
sri |
think there will be a release soonish, this is a pretty bad bug |
17:05 |
sri |
but i want to clean up some other tests too |
17:05 |
batman |
perfect. |
17:05 |
* batman |
is running the new version locally |
17:06 |
sri |
batman++ # the test case made it easy to track down the leak |
17:06 |
batman |
happy i could help :) |
17:08 |
batman |
hm... i might have found something else that is not cleaned up |
17:08 |
sri |
btw. if we could depend on newer perls i would just use "my sub app {}" |
17:08 |
* batman |
tries to make a new test |
17:08 |
sri |
your actual test didn't work, but that wasn't as important |
17:09 |
sri |
DESTROY has very good coverage now |
17:09 |
batman |
i know. i didn't bother to change push @destroyed, $c; #:( |
17:09 |
batman |
...what about local *app = sub { ... }; ? |
17:10 |
sri |
i don't care enough about it for hacks |
17:10 |
batman |
hehe ;) |
17:11 |
sri |
like i said, it's no real gain, apps still get stored in globals elsewhere |
17:11 |
sri |
just look at the eval command and the json config plugin |
17:11 |
sri |
and of course every lite app in existence |
17:12 |
sri |
what would be nice is exporting my subs into a scope |
17:13 |
sri |
like { use Mojolicious::Lite; app->... # works }; app->... # dies |
17:14 |
sri |
of course then we would get in trouble with other things, like Class->new |
17:14 |
batman |
could there be something else going on with ws than long polling request? |
17:15 |
sri |
be more specific |
17:15 |
batman |
i'm trying to run my test with just warn "..." inside the DESTROY and it still doesn't get called before global destruction... |
17:17 |
sri |
if you're testing that with client and server in the same process, the finish event and therefore destruction can be delayed on both ends |
17:17 |
batman |
oh. |
17:17 |
sri |
websocket shutdown timing is a bit wonky |
17:17 |
batman |
i see |
17:17 |
batman |
thanks |
17:17 |
sri |
if you have an idea for making it more reliable, be my guest |
17:23 |
batman |
on my side, i'm hooking myself into Mojo::Base::new() trying to track if there's any objects that survive after a request. |
17:24 |
batman |
i'm seeing a lot of Mojolicious::Routes::... objects surviving |
17:24 |
batman |
does that make any sense? |
17:24 |
* batman |
writes a new test |
17:39 |
batman |
i can't seem to get sub home { shift->render(text => "hello\n") } to work in a full app with the changes |
17:40 |
batman |
must be something else... |
17:42 |
batman |
Routing to controller "App::Ctrl" and action "home" # but no output... |
17:43 |
batman |
good. it was something else :) |
17:46 |
|
good_news_everyone joined #mojo |
17:46 |
good_news_everyone |
[mojo] kraih pushed 1 new commit to master: http://git.io/si4U9A |
17:46 |
good_news_everyone |
mojo/master 36da6b8 Sebastian Riedel: better tests for events |
17:46 |
|
good_news_everyone left #mojo |
17:47 |
|
dsteinbrunner joined #mojo |
17:53 |
sri |
batman: careful what you say, if you're too vague i might get suspicious and the release gets delayed |
17:53 |
batman |
yeah. don't get suspicious. i was doing really stupid things on my end. |
17:53 |
batman |
:) |
17:58 |
* batman |
hurry up releasing Mojo::Redis |
18:00 |
sri |
batman: any reason you're not tracking leaks with Devel::Cycle? |
18:01 |
sri |
find_cycle $self in the callback and voila, you got them all |
18:03 |
batman |
right. but i also want to find objects like sub app { $app } |
18:03 |
batman |
but i got tripped off earlier when mojo leaked :/ |
18:03 |
batman |
wasn't expecting that |
18:03 |
batman |
will probably go back to using Devel::Cycle... |
18:04 |
|
bjoernfan joined #mojo |
18:08 |
batman |
today will be my official leak day! |
18:09 |
batman |
...and Mojo::Redis 0.9914 is on it's way to cpan :) |
18:09 |
batman |
marcus: i think life will be pretty smooth later today |
18:26 |
|
dvinciguerra_ joined #mojo |
18:45 |
ruz |
hi |
18:46 |
ruz |
where do I read about content negotiation in Mojo? |
18:47 |
batman |
can you tell us what you try to achive, what happens and what you expect to happen? |
18:47 |
sri |
http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Content_negotiation |
18:48 |
ruz |
sri: thanks, exact match |
18:49 |
* ruz |
is trying |
19:01 |
|
good_news_everyone joined #mojo |
19:01 |
good_news_everyone |
[mojo] kraih pushed 1 new commit to master: http://git.io/ptAPyA |
19:01 |
good_news_everyone |
mojo/master 86f46c8 Sebastian Riedel: handle app function consistently |
19:01 |
|
good_news_everyone left #mojo |
19:01 |
sri |
batman: not a feature, just for consistency |
19:03 |
sri |
hmmm |
19:03 |
sri |
i wonder if localizing helpers in templates would affect performance |
19:07 |
|
basiliscos joined #mojo |
19:12 |
|
connor_goodwolf joined #mojo |
19:14 |
|
good_news_everyone joined #mojo |
19:14 |
good_news_everyone |
[mojo] kraih pushed 1 new commit to master: http://git.io/TkRU8Q |
19:14 |
good_news_everyone |
mojo/master 9d2ef39 Sebastian Riedel: localize all helpers |
19:14 |
|
good_news_everyone left #mojo |
19:14 |
sri |
doesn't appear to make a measurable difference |
19:20 |
|
marcus joined #mojo |
19:21 |
|
firnsy joined #mojo |
19:22 |
sri |
slightly measurable |
19:23 |
sri |
when rendering 10k templates (which takes around 2s it makes a difference of roughly 0.04s) |
19:23 |
sri |
variance is pretty high though |
19:25 |
ruz |
sent pull request :) |
19:26 |
sri |
ruz: thanks, but that doesn't sound like correct english |
19:27 |
ruz |
well, may be. it's more of a feature request and a stab :) |
19:27 |
ruz |
since I looked at the code I know what do and care less |
19:29 |
sri |
it's also already in the tutorial http://mojolicio.us/perldoc/Mojolicious/Lite#Content_negotiation |
19:30 |
ruz |
well, I missed that bit |
19:30 |
sri |
and in another part of the rendering guide http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Content_type |
19:31 |
sri |
i don't think it has to be duplicated everywhere |
19:31 |
ruz |
I readlly think that tutorial is short use case and expect more in doc rather than more in tutorial |
19:31 |
|
dotandimet joined #mojo |
19:31 |
ruz |
so overlooked by quickly skimming over tut |
19:32 |
ruz |
and jumping to api docs |
19:32 |
sri |
sure, but your sentence is just the same information again, it doesn't bring anything new to the table |
19:34 |
ruz |
your docs, I'm user, this is feedback, you're right I overlooked, if somebody else asks again then you know what to do :) |
19:34 |
sri |
i consider every pull request a finished patch |
19:35 |
sri |
feature requests and discussions are generally done here or on the mailing list |
19:35 |
ruz |
drop the pull |
19:35 |
ruz |
it's ok |
19:36 |
sri |
oh wait... your patch is actually for Mojolicious::Controller... that's definitely the wrong place |
19:36 |
* sri |
thought it was for the recipe he linked to |
19:37 |
ruz |
ok, ok |
19:39 |
ruz |
I'm just not used to docs in tutorials, guy who likes shorter API docs with lots of cross references |
19:39 |
ruz |
in mojo case I keep stepping on the fact that tutorials are better |
19:39 |
* sri |
is very picky about doc changes |
19:40 |
* ruz |
back to hacking on my api |
19:41 |
sri |
it's actually a rule "Documentation belongs to the guides, module POD is just an API reference." |
19:41 |
ruz |
k |
19:52 |
|
good_news_everyone joined #mojo |
19:52 |
good_news_everyone |
[mojo] kraih pushed 1 new commit to master: http://git.io/USYakA |
19:52 |
good_news_everyone |
mojo/master c13c7d6 Sebastian Riedel: mention how to change MIME type mappings in content negotiation recipe |
19:52 |
|
good_news_everyone left #mojo |
19:52 |
sri |
it's a bit odd though that the tutorial has more information there than the guide |
19:53 |
|
dotandimet joined #mojo |
20:05 |
ruz |
error "Class "Cpan::Tagger::Controller::Api" is not a controller."++ for 1..100500 |
20:05 |
|
jordan joined #mojo |
20:07 |
sri |
damn... the parent selector ticket is 2 years old now, and absolutely nothing happened in the meantime :o https://github.com/kraih/mojo/issues/236 |
20:13 |
|
mire_ joined #mojo |
20:13 |
|
russum joined #mojo |
20:13 |
|
russum left #mojo |
20:17 |
batman |
sri: "not a feature, just for consistency" ? |
20:17 |
batman |
i like it anyway :) |
20:18 |
sri |
batman: yea, i'm not testing it |
20:18 |
batman |
that's fine |
20:18 |
* batman |
want a new release... |
20:19 |
sri |
ruz: btw. i generally agree about good module docs, but 3 layers api reference > guides > tutorial is more in the nature of frameworks imo |
20:20 |
sri |
more stuff that overlaps too much to fit into modules docs |
20:20 |
batman |
sri: thanks for your help today. i'm going to get my beauty sleep now. |
20:21 |
batman |
see you around :) |
20:21 |
sri |
nn :) |
20:22 |
* sri |
goes to get some frozen yogurt now! |
21:05 |
|
howitdo joined #mojo |
21:27 |
|
KindOne joined #mojo |
21:31 |
|
denisboyun joined #mojo |
21:32 |
|
perlite joined #mojo |
21:42 |
ruz |
nice |
21:42 |
ruz |
it worked |
21:47 |
|
good_news_everyone joined #mojo |
21:47 |
good_news_everyone |
[mojo] kraih tagged v4.30 at 1ffd32f: http://git.io/pw4UfA |
21:47 |
|
good_news_everyone left #mojo |
21:51 |
sri |
batman: good morning! enjoy the leak free mojolicious 4.30 :) |
21:54 |
ruz |
sri: noticed that json doesn't go through encoding process in ->render |
21:54 |
ruz |
can be a bug |
21:54 |
sri |
it's not json if it's not already encoded |
21:56 |
ruz |
I mean json argument in Renderer->render goes to $self->{'json'}->(...) and returned |
21:57 |
ruz |
skipping $options->{encoding} at the end |
21:57 |
sri |
right, because it has to be encoded already |
21:57 |
ruz |
to utf-8 |
21:57 |
ruz |
I don't see any indication in the spec that it should be or must be utf-8 |
21:58 |
ruz |
SHALL be Unicode |
21:58 |
ruz |
it says |
22:00 |
ruz |
IANA considerations |
22:00 |
ruz |
JSON may be represented using UTF-8, UTF-16, or UTF-32. When JSON is written in UTF-8, JSON is 8bit compatible. When JSON is written in UTF-16 or UTF-32, the binary content-transfer-encoding must be used. |
22:00 |
sri |
RFC 2119: "MUST: This word, or the terms "REQUIRED" or "SHALL", mean that the definition is an absolute requirement of the specification." |
22:06 |
sri |
nobody cares about UTF-16 and UTF-32, and i'm saying that as the guy who added support for both to Mojo::JSON :) |
22:07 |
sri |
pretty much no decoder actually accepts those |
22:11 |
ruz |
:) k |
22:12 |
ruz |
just checked, you just don't send charset when json is rendered |
22:12 |
sri |
yea, decoders are supposed to detect the charset from the first few bits or assume utf-8 |
22:13 |
sri |
and it's always utf-8 anyway :) |
22:14 |
ruz |
anyway, another request for doc improvement: ended up in this code as wanted to figure out how to render my custom type |
22:14 |
sri |
custom type? |
22:14 |
ruz |
as render(xxx => "boo") didn't work |
22:15 |
sri |
ah, yea, you can't have custom reserved stash values |
22:15 |
ruz |
not that I expected it to work right away |
22:15 |
sri |
there is no way to make it work |
22:15 |
ruz |
render(data => 'xxx', format => 'xxx') |
22:15 |
ruz |
works |
22:15 |
sri |
funny, you're the third person recently to bring it up |
22:16 |
sri |
http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Content_type |
22:17 |
ruz |
format even can be omitted if it matches negotiated |
22:17 |
ruz |
yep, looked there |
22:18 |
sri |
that's a good point though |
22:19 |
ruz |
now I saw code and understand that that sample is for me |
22:21 |
ruz |
would be cool to see there "hey, here is how you send imaginary type 'foo': 1) register, 2) call render with text if you want it encoded with data if not 3) pass format" |
22:23 |
|
good_news_everyone joined #mojo |
22:23 |
good_news_everyone |
[mojo] kraih pushed 1 new commit to master: http://git.io/wUNzKg |
22:23 |
good_news_everyone |
mojo/master 53c1fc7 Sebastian Riedel: mention that the content negotiation result gets stored in the format stash value |
22:23 |
|
good_news_everyone left #mojo |
22:23 |
ruz |
success overall, just rendered my first application/hal+json |
22:24 |
ruz |
with negotiation, time to implement hal->html renderer |
22:24 |
ruz |
or to go sleep |
22:27 |
|
good_news_everyone joined #mojo |
22:27 |
good_news_everyone |
[mojo] kraih pushed 1 new commit to master: http://git.io/7n68Og |
22:27 |
good_news_everyone |
mojo/master 0c1f58e Sebastian Riedel: better Content-Type examples |
22:27 |
|
good_news_everyone left #mojo |
22:28 |
ruz |
sri++ |
22:28 |
sri |
ruz++ |
23:35 |
sri |
haha, ember.js vs angular.js http://vimeo.com/68215606 |