Top all-time · #5683
Joe Shaw
Personal blog · joeshaw.orgprogrammingsystems
Joe Shaw writes joe shaw, a personal blog at joeshaw.org about programming and systems. Since 2009, 13 different Hacker News readers have linked it 13 times, most often “Don’t defer Close() on writable files (Go)”. The last post was in 2021, but the archive is still widely read.
Too few sampled comments (2) to say how often HN recommends it.?
Why HN links it
HN readers link Joe Shaw's post 'Don't defer close on writable files', which covers the errors that close(2) can return. It is cited in a Rust compiler discussion.
Summarised by Claude from a sample of 2 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
joe shaw
Most-linked posts?
- Don’t defer Close() on writable files (Go)2 people · 2 mentions · first linked 2017-06-12
- Understanding Go panic output2 people · 2 mentions · first linked 2017-11-10
- Go's net/context and http.Handler2 people · 2 mentions · first linked 2015-05-07
- Don't defer Close() on writable files (2017)2 people · 2 mentions · first linked 2019-06-04
What Hacker News says?
Great question! Here is a better explanation than I could write: https://www.joeshaw.org/dont-defer-close-on-writable-files In resume, man close(2), gives us the potential errors. This is the output for Ubuntu 20.04 LTS: EBADF fd isn't a valid open file descriptor. EINTR The close() call was interrupted by a signal; see signal(7). EIO An I/O error occurred. ENOSPC, EDQUOT On NFS, these errors are not normally report…
Comment linking /dont-defer-close-on-writable-files
on “Bugs that the Rust compiler catches for you”Submitted Don't defer Close() on writable files (2017) as a story · 253 points
HN discussionPython is "less of a problem" but you still may hit that wall. You can do "stupid stuff" in any language and have that same outcome, php just gives more rope than the rest! Recently, on a short term contract, I had to deal with a lot of PHP code that was running in a similar manner. I ended up using golang, to monitor the queue and spin up Goroutines that executed the PHP code ONCE. Between the concurrency, and php…
Comment linking /net-context-and-http-handler/
on “Ask HN: Python or Go?”Submitted Understanding Go panic output as a story · 99 points
HN discussionSubmitted Don’t defer Close() on writable files (Go) as a story · 3 points
HN discussionSubmitted Go's net/context and http.Handler as a story · 3 points
HN discussionSubmitted Abusing go:linkname to customize TLS 1.3 cipher suites as a story · 2 points
HN discussionSubmitted Understanding Go panic output as a story · 2 points
HN discussionSubmitted Contributing to GitHub projects as a story · 2 points
HN discussionSubmitted Don't defer Close() on writable files – Golang as a story · 1 points
HN discussionSubmitted Don’t defer Close() on writable files as a story · 1 points
HN discussionSubmitted Python daemon threads considered harmful (2009) as a story · 1 points
HN discussionSubmitted Giticular cancer as a story · 1 points
HN discussion