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

IRC log for #mojo, 2016-10-11

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

All times shown according to UTC.

Time Nick Message
00:21 zivester joined #mojo
00:35 jabberwok joined #mojo
01:00 lluad joined #mojo
01:23 y1mmm joined #mojo
02:00 dave joined #mojo
02:01 dave jberger: in Mojo::IOLoop::ForkCall, how do you get the exit status of a process you forked?
02:01 lluad joined #mojo
02:03 asarch joined #mojo
02:07 Grinnz you don't, that would be a Mojo::IOLoop::ReadWriteFork kinda thing if you care about exit statuses/stdout/etc
02:07 Grinnz ForkCall just runs a subroutine and dies or doesn't
02:11 Grinnz if you have control over the subprocess code, you could have it die with an exception object which contains the information you needed, so that ends up in $err
02:13 dave ah I see
02:14 dave looks like ReadWriteFork is exactly what I want -and- it uses IO::Pty
02:15 Grinnz it's basically two mental models to the problem, either you're "running a subroutine in the background" or you're "running a process in the background (which might run perl code or might run an external command)"
02:15 dave yeah I have a module I've been using for years that does the latter and now I'm faced with doing it "non blocking" style
02:16 Grinnz forkcall gives you the return value(s) or the exception, and readwritefork gives you stdout/err/in and the exit status
02:16 dave have you used it?
02:16 Grinnz rwf?
02:16 purl rwf is probably the most directly tuned for this problem, in fact I almost mentioned it
02:16 Grinnz i haven't cause the only case where i needed it, i need separate stdout and stderr
02:16 dave ahh
02:16 dave yeah I actually need them merged
02:17 Grinnz it could probably be patched to support that but i dont know if i have the expertise to do it
02:17 dave and in order
02:17 dave looks pretty easy actually, you could open two ptys
02:17 dave he has an explicit i/o redirect there
02:18 Grinnz yeah probably. i just know whenever i think something involving pipes should be easy...
02:18 dave lol
02:19 dave well it's ptys not pipe
02:19 dave you want ptys to fool the application into thinking it's writing to a terminal (for my purposes anyway)
02:19 dave thanks Grinnz :D
02:20 Grinnz ahh, i didn't understand that distinction
02:21 dave saved me from rewriting ReadWriteFork completely, now I'll just have to write an interface shell around it
02:24 dave the author of readwritefork welcomes patches on what you asked about
02:24 dave interestingly enough, the hardest part is changing the "read" event interface spec ;)
02:26 Grinnz the author of readwritefork is also batman :P
02:29 dave For a moment, I thought you meant the -real- batman ;) I see, thanks. :D
02:29 Grinnz who's to say he isn't
02:29 dave hey, I don't mess with superheroes
02:50 noganex joined #mojo
03:01 jnbek joined #mojo
03:02 lluad joined #mojo
04:03 lluad joined #mojo
04:13 polettix joined #mojo
05:04 lluad joined #mojo
05:05 schelcj joined #mojo
05:28 inokenty-w joined #mojo
05:33 perlpilot_ joined #mojo
05:35 dod joined #mojo
05:40 dod joined #mojo
06:02 batman Grinnz: did you ever open an issue?
06:02 dod joined #mojo
06:03 batman dave: let me know if you have any feedback / questions.
06:05 lluad joined #mojo
06:25 polettix joined #mojo
06:49 Vandal joined #mojo
07:06 lluad joined #mojo
07:11 mbudde joined #mojo
07:20 trone joined #mojo
07:48 osfabibisi joined #mojo
08:07 lluad joined #mojo
08:16 rshadow joined #mojo
08:37 lluad joined #mojo
09:48 sri dell keyboards are really really bad
09:48 sri keys have almost as little travel as the 12" macbook
10:03 pink_mist http://imgur.com/gallery/InbxIxe
10:19 Atog https://www.youtube.com/watch?v=_GhODn4FRoE
10:56 lluad joined #mojo
10:58 tchaves joined #mojo
11:13 gregf_ joined #mojo
12:03 sri anyone ever found a good solution for testing if a box has ipv6 support?
12:04 sri all i can think of right now is perl -MIO::Socket::IP -E 'say eval { IO::Socket::IP->new(Listen => 5, LocalAddr => "[::]") } ? "[::]" : "0.0.0.0"'
12:09 kaare joined #mojo
12:10 suede sri: ifconfig?
12:10 purl ifconfig is probably nice or set in /etc/netstart
12:11 sri programmatically
12:11 purl programmatically is rather hard
12:11 suede oh
12:11 batman sri: do you mean if the OS supports ipv6 or if it actually has an ipv6 address set up?
12:12 sri the problem is when you listen on [::] and you have an ipv4 only box it will prolly die
12:14 batman why will it die? I thought IO::Socket::IP->new() returned object or false, and you had to check $@
12:15 coolo batman: https://github.com/os-autoinst/os-autoinst/issues/602 - that guy from IBM experimented :)
12:15 coolo (they just have too much free time in France :)
12:16 batman coolo: the reason it dies, is because Mojo::IOLoop::Server does `croak()`
12:22 asarch joined #mojo
12:28 sri batman: good point :)
12:28 kwa sri: a portable check, or just on linuxy OS'?
12:29 sri guess my one-liner should be perl -MIO::Socket::IP -E 'say IO::Socket::IP->new(Listen => 5, LocalAddr => "[::]") ? "[::]" : "0.0.0.0"'
12:29 batman sri: i think *maybe* if you do `Domain => PF_INET6`, then it might die...
12:30 batman but i'm not sure which system that wouldn't have PF_INET6 though...
12:31 * batman really likes adding support for `code` in convos :)
12:32 kwa perl -E 'say ((-e "/proc/net/if_inet6") ? "[::]" : "0.0.0.0")'
12:40 pink_mist surely that'll only work on linux
12:41 kwa I asked if sri wanted a portable way. Just put it out there regardless. :)
12:41 polettix joined #mojo
12:44 zivester joined #mojo
12:48 batman kwa: doesn't that just tell you if the OS supports ipv6?
12:51 kwa batman: I believe it only exists if the ipv6 module has been loaded.
12:52 batman i don't think that's the same as you can bind to an ipv6 address.
12:52 kwa modprobe ipv6; lsmod | grep ipv6
12:52 batman i think it would be strange if you can bind if none of your interfaces has an ipv6 address
12:53 kwa Hmm, I believe the file actually includes the address too.
13:13 gizmomathboy joined #mojo
13:13 ramortegui joined #mojo
13:26 ptolemarch joined #mojo
13:27 wlai2768 joined #mojo
13:30 wlai2768 Would it possible to run Minion 6.0 on Windows platform?  The last know working is on v5.09
13:32 kwa wlai2768: If you're struggling to run it natively on Windows, there are other ways to get it to work. E.g., a virtual machine of some sort.
13:32 kwa wlai2768: I'm assuming you don't want to run it in production, but more to play around with it?
13:33 nic If you already have the Windows platform in question then the easiest way to answer the question is to see if it installs (running the tests of course)
13:35 nic there are at least three different perl environments on Windows, so if one isn't working for you it doesn't always mean they all fail
13:35 kwa Looks like he's already raised an issue - https://github.com/kraih/minion/issues/45
13:35 wlai2768 I don't have problem running it natively up to v5.09
13:36 wlai2768 but starting 6.0, the check on $Config{d_pseudofork} has block it from starting normally.
13:36 nic ah, that's your answer then
13:39 wlai2768 by commenting that line, I'm able to start worker normal.  Submitted a few jobs, seem execute fine.
13:39 nic And it passes all tests?
13:41 nic If you can find the commit that introduced that line, it most likely has a good comment suggesting why it was appropriate
13:41 wlai2768 Minion build test are fine.  I got it installed without the need ot --notest using cpanm
13:41 wlai2768 ok. will check out the commit comment.
13:47 mcsnolte joined #mojo
14:02 go|dfish joined #mojo
14:09 gregf_ joined #mojo
14:10 wlai2768 Got to stick with 5.09 for a while... Minion::Backend::Mango has not implement the some of subclass required by 6.0
14:25 perlpilot joined #mojo
14:32 lluad joined #mojo
14:41 wlai2768 left #mojo
14:45 disputin joined #mojo
14:51 PopeF joined #mojo
14:51 zivester joined #mojo
15:20 ivi joined #mojo
15:25 tchaves joined #mojo
15:30 marty joined #mojo
15:30 tchaves joined #mojo
15:59 marty joined #mojo
16:07 asarch joined #mojo
16:07 PryMar56 joined #mojo
16:13 mtths joined #mojo
16:19 Janos joined #mojo
16:32 mishanti1 joined #mojo
16:40 juikuen joined #mojo
16:56 jnbek joined #mojo
17:18 sri supporting windows perl is just not worth it
17:22 jberger at least not for multi-process code, not now that WSL exists
17:22 jberger hell even microsoft doesn't use windows for its servers anymore :-P
17:27 genio That confuses me though.  The WSL has to provide a shim between the POSIX system and Windows core calls.  So, is the linux running on WSL just as slow as other things that make use of fork emulation?
17:31 dod joined #mojo
17:31 jberger it isn't a shim
17:32 * genio should go read again.  it's been a while
17:32 jberger the design is actually quite brilliant and it has existed in the NT kernel since 4.0 and was subsequently forgotten for a decade
17:32 jberger basically there was supposed to be a POSIX compliant portion of NT
17:32 jberger and it was built to handle that
17:32 jberger but then it got swept by the wayside
17:33 jberger and yes that subsystem DOES implement fork
17:33 jberger it just was never exposed through to the windows native api
17:34 jberger read: https://msdn.microsoft.com/en-us/commandline/wsl/faq
17:34 jberger and: https://blogs.msdn.microsoft.com/wsl/ and articles therein
17:35 jberger but I think it was the video in https://blogs.msdn.microsoft.com/wsl/2016/05/23/pico-process-overview/ that most impressed me
17:35 genio ah, thanks
17:35 jberger I'm rewatching too, just to be sure this is the video that I'm remembering
17:36 jberger it isn't the first one of the series, you might want to start there
17:41 genio that's a really good video so far
17:46 jberger ah, yes, I got to the fork bit, this is definitely the video I remembered
17:50 genio well, what I'm getting out of that is that a native win32 app will never be able to call fork directly.  So, you couldn't just assume the WSL is installed and build a win32 app using POSIX calls such as fork.
17:50 genio meaning everything must run starting from the bash shell. :/
17:51 genio So, strawberry perl will never just be installable and work as expected as a windows app
17:52 ptolemarch joined #mojo
17:53 jberger no
17:53 jberger and that is too bad
17:53 genio saddy mcsadface
17:55 mikegrb joined #mojo
17:56 rshadow joined #mojo
17:58 genio Now I'm again less than thrilled about the WSL
17:58 jberger also, I'm assuming that eventually there will be a better way to startup pico process stuff rather than from the cmd.exe shell
17:58 jberger yeah, it is a funny thing right, you are kinda glad it exists but it does feel like punting too
17:59 jberger but think of it this way, microsoft is seeing that punting as necessary enough that they are doing it
17:59 jberger consider what that means for userspace
17:59 jberger and think about what happened in the apple world when transitioning from MacOS (not macos, sigh) to OSX
18:00 jberger they did this same thing
18:00 jberger win32 is going to exist for quite a while, but I think you're going to see WSL taking over more and more critical bits of the broader windows ecosystem
18:01 genio I hope you're right about that.
18:01 BinGOs wait for clippy for bash
18:02 preaction isn't that what debian and ubuntu already have?
18:02 BinGOs http://www.extremetech.com/wp-content/uploads/2011/09/linux-boot-windows-81-640x353.jpg
18:03 * genio vomits a little
18:07 BinGOs we should count ourselves lucky that https://en.wikipedia.org/wiki/Microsoft_Bob never gained traction.
18:09 genio so THAT's where Bob the Builder came from!
18:18 sri btw. SourceCodePro is an amazing typeface
18:18 sri really appreciating atm how well it works cross platform
18:49 tyldis Using IOLoop::Subprocess I randomly (1 in about 100 cases) get "Magic number checking on storable string failed" from Storable.pm. Any quick thoughts before I go googling my eyes sore?
18:50 tyldis I assume something inside the App is caught in a bad state of some sorts. Which makes tracing it hard.
18:54 jberger BinGOs: oh gods, that thing
18:54 jberger tyldis: that means that nothing got sent back from the subprocess
18:55 jberger or rarely that something corrupted did, but almost always that nothing did
18:55 tyldis jberger: Okay. The 1 in 100 was me locating wrong part of the code. It's more like 1 in 10_000 calls.
18:56 jberger are you making 10_000 parallel calls?
18:56 tyldis Not at once, no :)
18:58 tyldis It's a workaround for SQLite inserts, forking them off with Subprocess
18:58 tyldis And it happens frequently
18:59 jberger oh, that's probably part of the problem
18:59 jberger I don't think that SQLite likes being used like that
18:59 tyldis I suspected that.
18:59 jberger it locks the file anyway, so you aren't getting yourself anything by doing that
18:59 tyldis It's in WAL mode, so I figured it could be okay
19:00 tyldis But the handle is coming from the main app, and I suspect that's a bad thing.
19:01 jberger Grinnz might be able to talk about that more knowledgably
19:02 tyldis It's okay. It's not a sane long-term solution anyways. We should probably replace it with statsd or similar
19:03 tyldis I have some recurring timers hitting every second, and the SQLite inserts make that unpredictable
19:03 tyldis Even with synchro off
19:12 Grinnz tyldis: parallel writes work fine with WAL mode. sqlite can be finicky about forking with an open connection/statement, but the magic number checking error indicates that the storable serializing of the return value died, as there is no error checking on that call
19:12 Grinnz is there any error output from the subprocess?
19:13 tyldis Grinnz: No, that's all I got I'm afraid
19:13 Grinnz also make sure you're not returning anything like a coderef from the sub
19:15 tyldis No return, but a ->commit is the final call in the sub.
19:16 tyldis I realize I need to make this more robust to get more info
19:16 Grinnz hm. that could end up returning the dbh. you could try adding an explicit return 1; or something
19:16 jberger oh, yeah, I've been bitten by that in ForkCall
19:16 tyldis Might be. It usually works. Jut one incident it did not. But I'll do an explicit return to be a little more safe
19:16 jberger you really really don't want to implicit return with this api design
19:16 tyldis jberger: Gotcha.
19:45 blonewolfs joined #mojo
20:07 polettix joined #mojo
20:21 disputin joined #mojo
21:12 sri oh neat, android 7.1 will come with f.lux mode built in
21:13 pink_mist cool
21:16 Grinnz android already does weird things with my display brightness :P
21:16 Grinnz (if I leave it on auto)
21:21 jberger nice, now if only I could get 7.0 on my s7
21:21 * jberger glares at Verizon
22:22 zivester joined #mojo
22:24 Grinnz jberger: is it reasonable to use Mojo::ACME to generate certs unrelated to mojo apps?
22:24 jberger absolutely, I need to find the time to make that easier to do, but yes absolutely
22:25 jberger alternatively, you can use acme-tiny which I basically ported straight out
22:25 Grinnz mm, was thinking about that
22:27 jberger to make it easier, I basically need to make pluggable challenge/response types
22:28 jberger I've been thinking about targeting the DNS challenge next
22:28 jberger because that one makes sense for the case of a non-mojo app interaction
22:29 jberger the nice thing about the http01 challenge is that with the plugin loaded in the app it can handle the challenge response for you, but it doesn't help if you don't have a mojo app or you have a self-contained mojo app like convos
22:29 jberger or galileo
22:29 purl i think galileo is a much better organized example
22:29 jberger awwww, thanks purl, botsnack
22:29 purl :)
23:33 ivi joined #mojo

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