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

IRC log for #mojo, 2017-08-21

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

All times shown according to UTC.

Time Nick Message
00:37 karjala_ joined #mojo
02:35 disputin joined #mojo
02:40 noganex_ joined #mojo
03:08 leffe joined #mojo
03:36 disputin joined #mojo
03:47 jasanj hi, I need fork to run a process,setup a timer for timeout, and get the result from child, like Mojo::IOLoop::ReadWriteFork do, but RWF seems not support Windows, I also find Mojo::IOLoop::Subprocess, work for me but still not support Win, Mojo::IOLoop::ForkCall can't run through on Windows by my test, do you have any suggesstion ?
03:49 jasanj ForkCall will give an error "An existing connection was forcibly closed by the remote host" if the subprocess run too much time (>200s)
03:50 jasanj hmm, I need my script work both on Linux and Win
04:04 dboehmer joined #mojo
05:43 inokenty-w joined #mojo
06:21 Vandal joined #mojo
06:25 dod joined #mojo
06:31 dod joined #mojo
06:37 trone joined #mojo
07:22 tomred joined #mojo
07:22 CandyAngel jasanj: It should work under WSL, but it won't with "native" Windows because that doesn't have proper forking
07:25 jasanj CandyAngel: you mean ALL of them doestn't work with 'native' Windows ?
07:26 jasanj Subprocess, RWF, ForkCall
07:28 CandyAngel I think it might also work in Cygwin?
07:29 CandyAngel I don't think so, if they use fork. I have the same problem at work wanting to use Minion
07:30 AndrewIsh joined #mojo
07:34 jasanj Cygwin might be ok, but my current working environment not support cygwin, i prefer to get a solution on native windows.
07:35 jasanj jberger: i have file an issue on github for ForkCall
07:35 CandyAngel It might be a case of it *can* work (Perl does emulate "fork") but there is a good reason it is coded to now allow it
07:35 CandyAngel coded to not allow it*
07:38 CandyAngel Mojo::Server::{Prefork,Hypnotoad} and Mojo::IOLoop::Subprocess all check if fork is emulated and stop, but none mention why so..
07:41 CandyAngel It does say that ForkCall should work on Windows though. What is happening when you try to use it?
07:41 brunoramos joined #mojo
07:44 jasanj CandyAngel: https://github.com/jberger/Mojo-IOLoop-ForkCall/issues/10
07:44 jasanj see this, there's an example script to reproduce the issue
07:45 * CandyAngel facepalms
07:46 * CandyAngel needs to wake up :P
07:52 CandyAngel Does it fail instantly or after a certain amount of time?
07:57 sri i doubt any of those will ever support windows without wsl
07:57 jasanj after a mount of time, i set a sleep 200s in the child process, if not sleep such long, for except 100s ,it's will be OK
07:58 jasanj for example
07:58 CandyAngel I'm just installing ForkCall so I can run it myself. I think that warning message is misleading
07:58 sri fork is emulated with threads, so it works completely different (shitty)
07:59 sri and no pipes for ipc
07:59 jasanj guys, i need have a meeting, come back later
08:00 dod joined #mojo
08:12 CandyAngel jasanj: I think Windows is closing the socket connection used by IO::Pipely due to inactivity
08:19 CandyAngel Yeah, 118 seconds works, 122 doesn't, so you're hitting a 120 second timeout
08:20 CandyAngel So I think it would need a parent->child keepalive..
08:33 rshadow joined #mojo
09:09 prg joined #mojo
09:42 petru joined #mojo
10:08 jasanj CandyAngel: yes, you'r right.
10:09 jasanj Is there a way to make IO::Pipely's pipely() keep alive
10:09 jasanj ?
10:12 CandyAngel I don't know off the top of my head, I've not used Pipely myself
10:12 CandyAngel I don't see anything for it in the documentation though
10:13 CandyAngel It may be that jberger can use socketpipely instead for Windows, then just send a keepalive "the wrong way" through the pipe?
10:13 CandyAngel socketpairly even
10:14 CandyAngel Oh, while I was reading, it may be a firewall closing the connection, rather than Windows itself
10:55 jasanj CandyAngel: i can't turn off my firewall of my windows box, so i can't have a test
10:55 mariusz joined #mojo
10:55 CandyAngel I can try it when I get home
10:58 jasanj thanks in advance, CandyAngel
10:59 tchaves joined #mojo
11:21 karjala_ joined #mojo
11:28 dod joined #mojo
11:32 petru joined #mojo
12:01 CandyAngel It's alright :P First proper use of my Windows VM now I can run it and my Linux VM side-by-side :P
12:11 dod joined #mojo
12:16 dod joined #mojo
12:20 dod joined #mojo
12:32 gizmomathboy joined #mojo
12:34 dod joined #mojo
12:43 dod joined #mojo
12:48 petru joined #mojo
13:14 fitnerd joined #mojo
13:16 zivester joined #mojo
13:28 vinnix joined #mojo
13:28 gryphon joined #mojo
13:35 ashimema how does the hypnotoad clients setting effect websocket connections?
13:36 Pyritic joined #mojo
13:38 ashimema being a long running connection does that mean I should be running with a high clients setting
13:40 tchaves joined #mojo
13:41 CandyAngel I think you'd set it to handle the expected userbase with some overhead, then use the hot deployment to increase it if you need to?
13:42 CandyAngel Or maybe you can just tell it to spawn more workers..
13:43 ashimema think I've just found at least one of the bugs I've been grappling with for days.
13:43 ashimema my hypnotoad clients was set to 1
13:43 ashimema so last client wins was happening.. ack.. how did I not spot that earlier..
13:43 ashimema thanks
13:49 ashimema be default, how many clients does morbo accept?
13:56 CandyAngel Having a quick look at the code, it isn't limited?
13:56 CandyAngel Maybe because it is for testing
13:57 CandyAngel /development
13:58 CandyAngel Morbo doesn't set max_clients on the Server::Daemon it uses
13:58 ashimema interesting..
13:58 ashimema I was certainly seeing a last connection wins at times
13:58 ashimema which has been confusing the heck out of me..
13:58 CandyAngel What do you mean by "last connection wins"?
13:58 * ashimema answer phone.. back in a bit.
13:59 CandyAngel Okie dokie
13:59 ashimema as in I'd open a new websocket connection and the previous one would disconnect with a 1006, abnormal close
13:59 CandyAngel Er.. that shouldn't happen anyway? max_clients would stop the new connection from connecting..
13:59 ashimema hmm
14:00 CandyAngel So I think it's something else
14:00 ashimema well it wasn't stopping new connections.. it appeared to be killing existing ones
14:00 ashimema ah.. ok..
14:00 ashimema back to the drawing board.
14:00 dod joined #mojo
14:01 * ashimema juggles back to phone call
14:04 CandyAngel Are you connecting to the workers directly or though nginx/apache/etc.
14:05 marty joined #mojo
14:10 Pyritic joined #mojo
14:24 genio 01
14:25 genio 00
14:25 genio oops
14:29 genio Gotta pay more attention when wiping down a keyboard
14:31 CandyAngel Don't worry, we know that is your password, but it just shows up as hunter2 for us
14:42 VVelox joined #mojo
14:47 tchaves joined #mojo
14:53 tomred joined #mojo
15:02 zivester joined #mojo
15:08 Alex342 joined #mojo
15:10 Alex342 Hei guys. I need a little help. I got some content_like test. And some fails. How could i debug them?
15:22 gregf_ joined #mojo
15:27 CandyAngel Alex342: Have you run the test verbosely?
15:28 CandyAngel ./app.pl test -v
15:33 Alex342 no
15:33 Alex342 i will try it
15:34 mib_kniv2a joined #mojo
15:35 ckriutz joined #mojo
15:35 ckriutz Hey everybody. Can I ask a quick question?
15:36 CandyAngel Don't ask to ask :P
15:36 ckriutz Good point. :)
15:36 ckriutz Making a quick POC...
15:36 Alex342 But thats the problem i think :)). Too much details. I cant debug that...
15:36 ckriutz I have a website that has a count, and if you push a button, will increment the count.
15:37 CandyAngel Alex342: Pastebin the output someplace and tell me which test fails, I might be able to see it
15:38 ckriutz if you click the button, I send it to a path /increment, which then renders home/index again, but adds the $count var.
15:39 ckriutz but it looks like the page might be cached? So while I think the $count had increased, the page has not reflected that.
15:39 CandyAngel ckriutz: So like.. /count/:value? /count/1, /count/2, count/3 etc?
15:40 CandyAngel Where are you storing the value you are incrementing?
15:40 Alex342 https://pastebin.com/ZuWJyJzi
15:40 ckriutz CandyAngel: More like shift->render('home/index', currentCount => $count++);
15:40 CandyAngel And where does $count come from?
15:41 ckriutz it comes from the beginning of the script - app.pl.
15:41 ckriutz my $count = 0;
15:42 CandyAngel Alex342: I have to admit, I don't recognise the (?^:) construct in the regex
15:42 Janos joined #mojo
15:42 CandyAngel Is that something you are providing?
15:45 CandyAngel Alex342: It's failing because those strings aren't in the responses you are getting
15:45 CandyAngel Line 217 say "text to normal" but you are looking for "text to recipient"
15:45 CandyAngel ckriutz: Global state like that is a bad idea :P
15:46 ckriutz CandyAngel: yeah... might be... Figured it was the simplest way to accomplish my goal.
15:46 ckriutz CandyAngel: Is there a better way?
15:47 ChmEarl joined #mojo
15:47 CandyAngel if you want to just do something quick, make a helper for it
15:47 ckriutz helper...
15:47 CandyAngel helper increment_count => sub { state $count = 0; return ++$count; }
15:47 ckriutz ah, okay, let me investigate that!
15:48 CandyAngel Then if you need to change the increment behaviour, just need to change it there (e.g. to make it persist to disk, get from database)
15:48 CandyAngel ckriutz: https://github.com/kraih/mojo/wiki/Working-with-helpers
15:48 cornelius joined #mojo
15:50 Alex342 left #mojo
15:56 CandyAngel (for anyone else watching, that is still global state :P)
16:01 rba_ joined #mojo
16:12 mcsnolte joined #mojo
16:27 S joined #mojo
16:42 karjala_ joined #mojo
16:56 rshadow joined #mojo
17:04 rshadow joined #mojo
17:07 mariusz joined #mojo
17:24 disputin joined #mojo
17:27 rshadow joined #mojo
17:29 disputin joined #mojo
17:47 ashimema CandyAngel, I'm connecting via apache as a proxy
17:47 ashimema wow.. lots of hours have passed.. catch you tomorrow if your around then ;)
17:54 CandyAngel That was quite a phone call. A good one I hope!
18:39 rba_ joined #mojo
18:42 rshadow joined #mojo
19:04 rshadow joined #mojo
19:08 stryx` joined #mojo
19:25 * CandyAngel goes to actually plug mouse/keyboard into Windows VM >.>
19:32 petru joined #mojo
19:48 mishanti1 CandyAngel: You are one brave sould.
19:48 mishanti1 s/ld/l/
19:50 CandyAngel huh? What makes you say that?
19:55 CandyAngel Hm, I can't even install Mojo::Server::ForkCall, perl crashes during tests
20:15 CandyAngel jasanj: I can't test it, I can't get Mojo::IOLoop::ForkCall to even install :/
20:16 CandyAngel Perl crashes during t/helper.t
20:20 eseyman joined #mojo
20:21 petru joined #mojo
20:32 CandyAngel Okay, force installed it and see the same behaviour with Windows firewall off. 118 seconds works fine, 122 seconds gives that error
20:55 stryx` joined #mojo
21:46 zerah joined #mojo
22:13 Pyritic joined #mojo
22:34 stryx` joined #mojo
23:33 disputin joined #mojo

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