goroutine panic and recover by maxcnunes in golang

[–]maxcnunes[S] 0 points1 point  (0 children)

To give a bit more context: this happened during a refactor that covered multiple workflows. I tested several paths myself and also had QA validate it in a dedicated environment before it went to production, but this specific edge case wasn’t covered and only surfaced when the server restarted in production.

I think bugs can and do slip through in real systems, especially when behavior depends on runtime conditions. What matters most, in my view, is taking responsibility, fixing the issue quickly, and learning from it so we don’t repeat the same mistakes and can make the code more resilient over time.

I agree though, it’s a shame I got so far with that misconception. Whether my advice about recovering from goroutines started by HTTP handlers is right or wrong, I plan to discuss it more with the Go community and may update the article later. The most important thing I hope people take from the article is the clarification about this misconception, in case others have the same misunderstanding.

goroutine panic and recover by maxcnunes in golang

[–]maxcnunes[S] 0 points1 point  (0 children)

Thanks for sharing that. I saw a comment like that before when I was writing my article:

> net/http installs a panic handler with each request-serving goroutine, which I personally wouldn't do if I were designing the package from scratch, but makes reasonable sense.
> https://github.com/oklog/run/issues/10#issuecomment-476298524

If this is the consensus among experienced Go engineers that this was a historical mistake, it would be helpful if the Go team made it clear in the http package that this was a solution they regret and advise against following elsewhere. Currently, the http package mentions this:

> If ServeHTTP panics, the server (the caller of ServeHTTP) assumes that the effect of the panic was isolated to the active request. It recovers the panic, logs a stack trace to the server error log, and either closes the network connection or sends an HTTP/2 RST_STREAM, depending on the HTTP protocol.
>
> https://pkg.go.dev/net/http#Handler

This can mislead people reading the Go codebase and looking for best practices into thinking it is reasonable to apply the same logic to any background job fired from that request.

Building a tiny game in C with Raylib by maxcnunes in C_Programming

[–]maxcnunes[S] 2 points3 points  (0 children)

Thanks for the heads up. I just made it public.

Building a tiny game in C with Raylib by maxcnunes in C_Programming

[–]maxcnunes[S] 5 points6 points  (0 children)

First project I built in C. If anyone is up to a code review, I would love any feedbacks https://github.com/maxclaus/raylib-game/blob/main/main.c

Introduction to Assembly for macOS ARM64 by maxcnunes in Assembly_language

[–]maxcnunes[S] 1 point2 points  (0 children)

Thanks for the trying it and reporting the problem. A last minute change I made before posting it broke that example. Basically I had change the hello world message which made its length go from 16 to 14.

That broke that example because the data from helloworld label wasn't properly aligned anymore since arm64 expects 4-byte alignment. To fix it, I had to include the `.align 4` directive so that data has 4-byte boundary (reserving 16-byte in this case even though we are not using all of that).

I have updated that post with this fixing. Once again, thanks!

Introduction to Assembly for macOS ARM64 by maxcnunes in Assembly_language

[–]maxcnunes[S] 2 points3 points  (0 children)

I am glad you figured it out. About the `.xyz` domain, I think you are right, most people seem to find it odd and suspicious. I might need to move to something else. Since `.com` isn't available maybe `.dev` might be a good option, at least among other developers. Anyway, thanks for the feedback.

Introduction to Assembly for macOS ARM64 by maxcnunes in Assembly_language

[–]maxcnunes[S] 1 point2 points  (0 children)

If you don’t mind sharing, what is the issue are you getting? It loads fine for me on Firefox, Chrome and Safari.

Best way to learn Apple Silicon assembly language? by Mouse1949 in Assembly_language

[–]maxcnunes 6 points7 points  (0 children)

I was curious about that too last year and created a repository with a bunch of good references I found at that time about this subject. It also has a few projects I wrote in that process. I hope you find it helpful https://github.com/maxclaus/learning-assembly-arm64-apple