|
|
Subscribe / Log in / New account

Go filesystems and file embedding

Go filesystems and file embedding

Posted Jul 30, 2020 17:48 UTC (Thu) by mgk (guest, #74833)
In reply to: Go filesystems and file embedding by Cyberax
Parent article: Go filesystems and file embedding

While there are places contexts don't make sense, I'm 100% behind you that there's a lot coming out without context support, that is a head scratcher: Like filesystems. I had hoped we stopped assuming filesystems were always available, always fast, never hung, etc. back in the 90's...


to post comments

Go filesystems and file embedding

Posted Jul 31, 2020 7:23 UTC (Fri) by ibukanov (subscriber, #3942) [Link] (4 responses)

On the other hand Linux still lacks a good story with cancelable local file reads. Adding context to file-related API would be a lie on a most popular server system.

Go filesystems and file embedding

Posted Jul 31, 2020 7:38 UTC (Fri) by Cyberax (✭ supporter ✭, #52523) [Link] (2 responses)

Not all filesystems are local. Cancellation is very much possible for NFS (for which I'm actually already using a Go-based client).

Go filesystems and file embedding

Posted Jul 31, 2020 9:14 UTC (Fri) by benhoyt (subscriber, #138463) [Link] (1 responses)

By cancellation in this context, do you mean timeouts/deadlines? Or actually being able to cancel a read/write at any given time? If it's timeouts, does it work to specify a read/write timeout when you open the filesystem client (or Open() a file), rather than for example having a ctx/timeout on every Read call? Similar to what Russ Cox asks here: https://www.reddit.com/r/golang/comments/hv976o/qa_iofs_d...

Go filesystems and file embedding

Posted Jul 31, 2020 14:28 UTC (Fri) by ibukanov (subscriber, #3942) [Link]

By cancelable in my initial response I meant ability to interrupt a given blocked call so it returns immediately. Timeouts are a subset of that.

What would be ideal if FileHandle can be used as a pseudo-channel in the select statements in Go. But that requires very non-trivial implementation especially on Linux.

Go filesystems and file embedding

Posted Jul 31, 2020 12:35 UTC (Fri) by gray_-_wolf (subscriber, #131074) [Link]

Context is not used just for cancellation. For example, we are passing logger in it. So for those cases it would still be useful even if you cannot actually cancel the operation.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds