Skip to main content
  1. Weeknotes/

52

This week was a little rocky, which I attribute to a combination of a “holiday hangover” – time spent celebrating rather than recharging – along with most of the team being off. They all deserve the time off – I could not continue building Polytomic without them – but it did mean more on my shoulders.

That said I managed to ship a few things that have been on my radar for a while.


First, completing ripping out sqlc, standardizing on go-pg. Do not take this as an endorsement of one over the other: if SQLc made it easy to fetch related objects and let me split up my models in different packages, we never would have looked elsewhere. Rather, consider it an endorsement of the “one way principle”:

There should be one– and preferably only one –obvious way to do it.

The other notable database-related improvment was finally figuring out what was causing EOF errors when querying Postgres from Go. We’d figured out that it seemed to be related to the client using a connection the server had closed, but couldn’t figure out why. Lowering the maximum age for connections in the pool had helped, but it still popped up now and again. Interestingly, finally consolidating on go-pg led to it occurring more frequently.

After realizing we were making a Redis call while the transaction was open – and noticing that our Redis load has been steading increasing – I raised idle_in_transaction_session_timeout and the problem disappeared immediately. TIL.


I also finally migrated my personal website off of WordPress and onto Hugo. I’ve been running WordPress for quite a while, and have been hosting at Dreamhost for several years. But it’s never felt like a good value: I simply haven’t been posting enough to make it worthwhile. It took some wrangling, but I’m back in text/plain land. One thing that I’m still not 100% clear on is how templates work. Like, I’ve managed to get it working enough, but I wish it was clearer at a glance what template is called when.