Logs: liberachat/#haskell
| 2021-07-30 03:06:30 | × | roboguy_ quits (~roboguy_@2605:a601:afe7:9f00:b4cc:f31a:f38e:2215) (Remote host closed the connection) |
| 2021-07-30 03:07:03 | → | roboguy_ joins (~roboguy_@2605:a601:afe7:9f00:b4cc:f31a:f38e:2215) |
| 2021-07-30 03:11:15 | <lechner> | Hi, what's this, please? file descriptor 1024 out of range for select (0--1024). Recompile with -threaded to work around this. haskell |
| 2021-07-30 03:11:51 | × | roboguy_ quits (~roboguy_@2605:a601:afe7:9f00:b4cc:f31a:f38e:2215) (Remote host closed the connection) |
| 2021-07-30 03:12:03 | → | roboguy_ joins (~roboguy_@2605:a601:afe7:9f00:b4cc:f31a:f38e:2215) |
| 2021-07-30 03:13:23 | <c_wraith> | you opened a lot of files |
| 2021-07-30 03:13:41 | <c_wraith> | honestly, that error message seems to say everything relevant |
| 2021-07-30 03:13:51 | <c_wraith> | what part of it is unfamiliar? |
| 2021-07-30 03:14:56 | × | acowley quits (~acowley@c-68-83-22-43.hsd1.nj.comcast.net) (Read error: Connection reset by peer) |
| 2021-07-30 03:15:13 | × | ext0l quits (~vector@157-131-102-171.fiber.dynamic.sonic.net) (Ping timeout: 258 seconds) |
| 2021-07-30 03:17:42 | <lechner> | it's a socket-based worker that does not open or write any files https://dpaste.org/Rte0 |
| 2021-07-30 03:17:50 | → | acowley joins (~acowley@c-68-83-22-43.hsd1.nj.comcast.net) |
| 2021-07-30 03:17:52 | <c_wraith> | sockets still use file descriptors |
| 2021-07-30 03:19:35 | <c_wraith> | select is a system call that waits for activity on any* number of file descriptors, then tells you which one had activity. *except there's a max it can wait for, and it seems to be 1024 on your system |
| 2021-07-30 03:20:10 | <c_wraith> | if you compile with the -threaded option, ghc will link against a different runtime that doesn't use the select system call |
| 2021-07-30 03:21:19 | → | nate3 joins (~nate@108-233-125-227.lightspeed.sntcca.sbcglobal.net) |
| 2021-07-30 03:21:37 | <lechner> | i think the ZeroMQ sockets, which I am trying to close and reopen following a recommendation from upstream, are not getting closed even thoug i used their code example. i'll have to investigate. thanks! |
| 2021-07-30 03:22:34 | <dsal> | lechner: One thing that's unrelated this problem that you may want to consider is that you pretty much don't ever want to call `error` |
| 2021-07-30 03:23:37 | <dsal> | Oh. I don't think you are, you just name something error. That was confusing. :) |
| 2021-07-30 03:23:47 | <lechner> | yeah |
| 2021-07-30 03:23:57 | <lechner> | i was looking for the word |
| 2021-07-30 03:24:07 | <lechner> | it's not a variable, is it? |
| 2021-07-30 03:24:50 | <dsal> | :t error |
| 2021-07-30 03:24:50 | <lechner> | it used to be 'e' but i write out most words |
| 2021-07-30 03:24:51 | <lambdabot> | [Char] -> a |
| 2021-07-30 03:24:57 | × | geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection) |
| 2021-07-30 03:25:10 | <lechner> | no i meant my use |
| 2021-07-30 03:25:12 | × | roboguy_ quits (~roboguy_@2605:a601:afe7:9f00:b4cc:f31a:f38e:2215) (Remote host closed the connection) |
| 2021-07-30 03:25:20 | × | berberman quits (~berberman@user/berberman) (Ping timeout: 256 seconds) |
| 2021-07-30 03:25:23 | <lechner> | an 'immutable'? |
| 2021-07-30 03:25:30 | <dsal> | Sure. You're just shadowing it. |
| 2021-07-30 03:25:34 | × | nate3 quits (~nate@108-233-125-227.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 258 seconds) |
| 2021-07-30 03:25:45 | → | roboguy_ joins (~roboguy_@2605:a601:afe7:9f00:b4cc:f31a:f38e:2215) |
| 2021-07-30 03:25:46 | <lechner> | because it's in Prelude? |
| 2021-07-30 03:25:50 | → | Izem joins (~Izem@bras-base-london1483w-grc-42-65-95-172-41.dsl.bell.ca) |
| 2021-07-30 03:25:54 | → | berberman joins (~berberman@user/berberman) |
| 2021-07-30 03:26:27 | <dsal> | Yeah. |
| 2021-07-30 03:27:22 | <lechner> | i'll try to avoid that. thanks for the hint. do not know so much yet |
| 2021-07-30 03:27:26 | <dsal> | This code is a lot taller than I'm used to. Some of the wrapping is a bit weird as well. e.g., this is kind of confusing. https://usercontent.irccloud-cdn.com/file/pkcD1BAp/Screen%20Shot%202021-07-29%20at%2020.27.03.png |
| 2021-07-30 03:27:54 | <dsal> | I don't see people putting long names on variables that much. `e` is fine. Not naming it is even better. |
| 2021-07-30 03:28:17 | <lechner> | how? |
| 2021-07-30 03:29:30 | <lechner> | the formatting is from brittany, which did something about the long lines |
| 2021-07-30 03:30:07 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 2021-07-30 03:30:07 | × | roboguy_ quits (~roboguy_@2605:a601:afe7:9f00:b4cc:f31a:f38e:2215) (Ping timeout: 245 seconds) |
| 2021-07-30 03:30:25 | <dsal> | Something like this: https://www.irccloud.com/pastebin/HvYTa6jj/thing.hs |
| 2021-07-30 03:30:42 | <lechner> | i think the underscores are weird. they come from the JSON |
| 2021-07-30 03:30:52 | <dsal> | I've never seen anything formatted with that. It likes really tall code for some reason. |
| 2021-07-30 03:31:22 | <dsal> | I missed some parens there, but something like that |
| 2021-07-30 03:31:23 | <dsal> | :t either |
| 2021-07-30 03:31:24 | <lambdabot> | (a -> c) -> (b -> c) -> Either a b -> c |
| 2021-07-30 03:31:32 | <lechner> | i didn't think it was as bad as ormulo |
| 2021-07-30 03:31:36 | → | ext0l joins (~vector@157-131-102-171.fiber.dynamic.sonic.net) |
| 2021-07-30 03:32:15 | <dsal> | (also, you don't need `do` there -- I just left out the `ExitSuccess -> ` bit part. |
| 2021-07-30 03:32:18 | <dsal> | ) |
| 2021-07-30 03:32:42 | <lechner> | yeah. well my code stinks a little. i have to brush someone's teeth. brb |
| 2021-07-30 03:33:09 | → | roboguy_ joins (~roboguy_@2605:a601:afe7:9f00:b4cc:f31a:f38e:2215) |
| 2021-07-30 03:33:43 | <dsal> | It looks like you're establishing a connection in each iteration of the loop and then just like, keeping it open. |
| 2021-07-30 03:34:38 | → | geekosaur joins (~geekosaur@xmonad/geekosaur) |
| 2021-07-30 03:35:32 | → | pfurla joins (~pfurla@ool-182ed2e2.dyn.optonline.net) |
| 2021-07-30 03:35:38 | × | sh9 quits (~sh9@softbank060116136158.bbtec.net) (Quit: WeeChat 3.0.1) |
| 2021-07-30 03:35:49 | <dsal> | :t bracket -- lechner |
| 2021-07-30 03:35:50 | <lambdabot> | IO a -> (a -> IO b) -> (a -> IO c) -> IO c |
| 2021-07-30 03:36:03 | → | lavaman joins (~lavaman@98.38.249.169) |
| 2021-07-30 03:37:53 | → | nate3 joins (~nate@108-233-125-227.lightspeed.sntcca.sbcglobal.net) |
| 2021-07-30 03:38:19 | × | zebrag quits (~chris@user/zebrag) (Quit: Konversation terminated!) |
| 2021-07-30 03:38:24 | × | pfurla__ quits (~pfurla@216.151.180.237) (Ping timeout: 250 seconds) |
| 2021-07-30 03:40:04 | <dsal> | Actually, this API is super weird. You'd need to make your own `withConnection` thing possibly with `bracket` but their API is weird. |
| 2021-07-30 03:40:22 | <dsal> | Normally you'd do something like `bracket (open something) close $ \conn -> do stuff with conn` |
| 2021-07-30 03:40:38 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 256 seconds) |
| 2021-07-30 03:41:51 | → | paddymahoney joins (~paddymaho@cpe9050ca207f83-cm9050ca207f80.cpe.net.cable.rogers.com) |
| 2021-07-30 03:45:56 | → | curiousgay joins (~curiousga@77-120-186-48.kha.volia.net) |
| 2021-07-30 03:49:07 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 2021-07-30 03:50:38 | × | xff0x quits (~xff0x@2001:1a81:532e:4200:3fe0:364:9ae2:d4b0) (Ping timeout: 272 seconds) |
| 2021-07-30 03:51:00 | <dsal> | I don't know zeromq all, but I'm going to guess each one of these `connect` calls is eating a file descriptor and you never free it. It's a good thing you ran out of file descriptors as it made it easier to catch this bug earlier. |
| 2021-07-30 03:51:01 | → | xff0x joins (~xff0x@2001:1a81:532e:4200:e3f6:df0f:3d23:2506) |
| 2021-07-30 03:51:51 | <lechner> | the ZeroMQ stuff is from here: https://zguide.zeromq.org/docs/chapter1/ |
| 2021-07-30 03:52:06 | <lechner> | hw client in haskell |
| 2021-07-30 03:52:41 | <lechner> | although in all fairness i moved the 'connect' inside the loop |
| 2021-07-30 03:53:34 | <dsal> | It claims to have a finalizer on the socket but like, that's not the right way to do that kind of thing. |
| 2021-07-30 03:54:33 | <lechner> | in chapter 4 they recommend cosing and reopening. i am eventually trying to get to the Laz Pirate pattern (which they say does that) but i did not understand it in haskell https://zguide.zeromq.org/docs/chapter4/ |
| 2021-07-30 03:55:25 | <lechner> | there are several zmq libraries but i think the FFI bindings are pretty much preferred everywhere now |
| 2021-07-30 03:56:08 | <dsal> | That code seems to be reopening on failure and just completely ignoring the previously opened connection hoping the finalizer will eventually figure it out. |
| 2021-07-30 03:56:40 | <lechner> | yeah that's why i thought it was okay |
| 2021-07-30 03:57:59 | <dsal> | You should generally close things you open. I don't know as much about how finalizers work in haskell, but bracketing is generally the right thing to do. |
| 2021-07-30 03:58:26 | <lechner> | it's actually a great socket system, beating out AMQP in many places (like CERN), but the inventor died |
| 2021-07-30 03:59:16 | <lechner> | i know even less about finalizers |
| 2021-07-30 03:59:34 | <dsal> | I've never tried it. Most of the things I do that are anything like this are using MQTT. |
| 2021-07-30 04:00:08 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 252 seconds) |
| 2021-07-30 04:05:57 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-07-30 04:07:06 | × | nate3 quits (~nate@108-233-125-227.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds) |
| 2021-07-30 04:08:50 | × | slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving) |
| 2021-07-30 04:08:51 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Quit: FinnElija) |
| 2021-07-30 04:09:49 | <dsal> | This doc is pretty nice, though. |
| 2021-07-30 04:11:15 | <lechner> | try it. sometimes you just need a better socket. |
| 2021-07-30 04:12:27 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 2021-07-30 04:13:14 | <monochrom> | Finalizers are run at GC time only. |
| 2021-07-30 04:13:46 | <monochrom> | Unfortunately the threaded RTS is so nice to, when it detects idleness, run GC. |
| 2021-07-30 04:14:17 | <monochrom> | This has encouraged very reckless habits of ignoring to close anything and then complaining that the unthreaded RTS leaks. |
| 2021-07-30 04:14:29 | <monochrom> | s/ignoring/neglecting/ |
| 2021-07-30 04:15:34 | <lechner> | i think i saw some of those bug reports |
All times are in UTC.