SabeanDev
2 subscribers
7 photos
1 video
4 links
Download Telegram
So, mostly, today, I was debugging. One of the unusual bugs that I encountered today had to do with a closed network socket. The setup I was working with had two file-serving containers. Now, what happens if one of the two servers fails? What happens to the client end that was fetching data, or to the new client that is going to get routed to the broken server? The system should be capable of self-healing. In a sense, the file(s) should continue to be served.

One place where you can set up a health check on your file servers is at the routing stage. The routing stage in my setup is a stage where a client requests a file and then gets provided with a unique address of the CD (Content Delivery) server. The central server then makes sure the CD server is live before forwarding its address to the client in need. Well, easier said than done tbh.

To check if this was working like I just said, I purposely shut down one of the two servers. The central server was supposed to see that the server was down and order the second server to download all the files that were cached by the first server from S3 object storage. Well, that didn't happen. It was instead throwing ClosedChannelException at my face.

It took me a while to notice that it was an IO exception caused by a nonexistent socket (port), which shouldn't be handled by the global Exception handler. This exception should indeed be taken as a negative of the health check. Putting it inside a try-and-catch block was the answer.

Well, lesson learned!!!!!
SabeanDev pinned «first timer here kindda shy, will figure it out though.»
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Guess who called an Async method inside a @Transactional annotated method of the same class? It is I 😑. Don't do it you are in for database inconsistencies you are not ready for. I feel like I have to rant about inversion control proxies for a bit.
The delusion gets worse every other day.
Was working on this project that I wanted to move fast, and I decided to use "agentic development." I wouldn't even call it vibe coding; I knew everything that had to be built prior, but I wrote less code. And I can say with absolute certainty that AI is still not that good. And I don't even know what the hype is about anymore.
The feature that I asked the AI to build, which it couldn't do all day long, was this:

So, when a user wants to upload an image, it asks the central server for an upload slot. The server authenticates the request for proper authorization, and then generates A UUID name for the file and an upload ticket, saves the ticket and the generated UUID name in a memory cache, in my case, Caffeine (but in production will be Redis), and then sends the generated UUID name and the upload ticket back to the client. The client then uploads the file to an nginx server. For now, there is no custom file system; nginx just stores it in a shared Docker volume. But before accepting the put methods sent by the client, it (Nginx) forwards the UUID (name) + Upload Ticket to the central server for auth. The central server then checks the cache for the specific key entry <Upload Ticket, UUID> after making sure the ticket is valid, and also that the file name the client is uploading is the same as the one stored in memory.

That was it; not in a single universe is that a complex spec to implement, which the AI failed to do.

I just gave up on it now, and I'm gonna have to go through the slop and fix it myself. It would have been better if I wrote the implementation myself. I genuinely don't know how people are making anything that is serious with AI.

(or am I a dumb 🥷🏿 who doesn't know how to properly prompt "iA"?)
Laughing my ass off cause of ts comment.
if you understand the pain beyond this snippet of code, i am sorry that you had to go through it
I now know why old Java was hated so much. No one gets paid enough to maintain corporates' legacy corpus.
i didn't
when the 3 hours sleep catches up with you.
how would people believe me i spent 2 hours debugging this end point, to find out it was just....
......in the long run I almost lose nothing. If AI becomes drastically better than what it is now, prompting a model to do what you want is not hard...I will adapt, so I won't struggle to shift ( I highly doubt AI models will get that better from now on; the underlying model.) But, above all, I love programming lol. I didn't choose the field I am in, just for the money, it was also because I am passionate about it. When I say "forever" it is backed by the fact that Coding models are meh at best, expensive asfk, and take the fun out of something I genuinely love doing.