r/ProgrammerHumor • • Oct 06 '26

Advanced abideTheRulesIncidentCanWait

Post image
807 Upvotes

56 comments sorted by

186

u/m1k3st4rr Oct 06 '26

You forgot the part where the root cause was a commit made and pushed by a coworker at 2:17am

68

u/Almadan Oct 06 '26

"long forgotten issue found"

77

u/RodionGork Oct 06 '26

One real issue of such kind I remember "birthday congratulations suddenly stopped working to users on new year night!"

my lead was on duty and he spent 2 hours figuring out that "birthday" was non-nullable column, historically, and users who haven't set birhtday date had "1970-01-01" by default and get congratulated on January 1 (millions of them - it was "Tango" messenger by then)

So someone clever just hardcoded "if date is Jan 1st then return" in congratulations sending logic. Years ago.

7

u/ShAped_Ink Oct 06 '26

Could hav elitetally been fixed with adding the year too.

2

u/RodionGork Oct 06 '26

well, though some people would say it is still ugly, this approach is at least much more "targeted" and is much simpler than modifying column nullability in prod db :) so I second this

4

u/laplongejr Oct 06 '26

Yeah, but then you need to justify why the birthday check requires access to the year.   Skipping 1st Jan for one year may have been a safer decision than accessing private data on a hotheaded decision. 

Gives a year for a server-side fix of the column, or at least provide some privacy-focused alternative.  

(If the column isn't nullable, maybe a view that does return MMDD or null if 1/1/1970)  

1

u/ShAped_Ink Oct 06 '26

Actually the best solution (that I just didn't wanna write down before) is making a column that states if birthday date was set, so the value in birthday itself doesn't matter if not set. I know adding columns willy nilly isn't a good practice, but how els would you take care of this problem, not give access to the year and not exclude people with birthday on 1.1.1970? You'd just check first if the flag is true and if it is, you look at the birthday.

2

u/laplongejr Oct 06 '26 edited Oct 06 '26

Sure, but adding a column is likely to take time, or at least requires to discuss it with the team in charge of the database side etc.   If the problem was found 3 days before the christmas freeze, better to block it in a rush and have 11 months to work on it. (Especially if the reminder would take the form of millions of emails)  

Oh and obv if adding a "is date null?" column is possible, at some point there should be a way to make the column nullable anyway  

1

u/IlgantElal Oct 09 '26

Or just allow it to be nullable? Having a "non-nullable" column that has an unset state is lazy. While it likely has a reason (date picker doesn't always allow null), this should be handled outside the db

39

u/Breadynator Oct 06 '26

"Nobody's born on January 1st anyways! It's new year's eve, not some random birthday!"

26

u/ligma_then_sugma Oct 06 '26

So someone clever just hardcoded "if date is Jan 1st then return" in congratulations sending logic.

management material

4

u/laplongejr Oct 06 '26 edited Oct 06 '26

Tbf if it was pushed on Dec29 it could be understood. Better than send millions of emails(?) to people who never gave their birthday.  

1

u/ligma_then_sugma Oct 06 '26

there's always an exception, true

sometimes u gotta do some wild shit

2

u/flerchin Oct 06 '26

Who cares about the birthday congrats not working. That costs the company zero dollars

8

u/ryuzaki49 Oct 06 '26

A build failing due to a commit message? That's just madness

4

u/RodionGork Oct 06 '26

they have some tools which extract commit messages for some purposes, coordination with issue tracker etc, and these tools seemingly sometimes pick "subj" up to the empty line. but actually this rule is wrong - subj is always 1-liner (git works so), so it shouldn't check for empty line anyway.

337

u/shnutzer Oct 06 '26
  • pre-check failed
  • retry pipeline
  • random docker image / other infra update wedged into the CI pipeline failed
  • retry pipeline
  • inexplicable failure to create environment for integration tests
  • retry pipeline
  • 1 out of 1000 integration tests is flaky and just failed
  • retry pipeline
  • deployment to dev environment failed
  • retry pipeline
  • deployment to stage environment failed
  • retry pipeline
  • ready to deploy to live, you push the button, but must wait for rolling deployment
  • deployment to live failed after 30 minutes because 1 out of 10 pods failed to update within the time window
  • retry pipeline

and that's why we have a separate tool for deploying hotfixes quickly

176

u/Zeikos Oct 06 '26

and that's why we have a separate tool for deploying hotfixes quickly

I never understood why make CI/CD pipelines so central to everything to then flat out ignore them when they have issues instead of maintaining them.
What's the point of using them if they get ignored?

112

u/shnutzer Oct 06 '26

I'm exaggerating of course, but even if the whole pipeline worked perfectly then all of the steps take a good 30-60 minutes to run if not longer

So if you have an absolutely critical hotfix that must be deployed at 3am you may choose to skip the process at your own risk

Of course we don't just ignore them for normal deployments

42

u/auxiliary-username Oct 06 '26

I’ve done the same many times. But having a sleepy solo dev going off-script and inventing new deployment procedures at 3am always seems like a great way to turn an emergency into a catastrophe.

25

u/devrelm Oct 06 '26

Who said anything about inventing new deployment procedures at 3am?

The hotfix pipeline is something you create when creating your standard deploy pipeline — or at least once the standard pipeline starts taking longer than your team is comfortable deploying hotfixes with.

In case of emergency, there should always be a separate hotfix pipeline that is streamlined to your team's process and aversion to risk. It may or may not include a deploy to your staging environment, but should likely skip dev. It should run the whole test suite, but that can be skipped or trimmed to a subset of the tests if your team values delivering a fix quickly over ensuring that regressions aren't introduced (you may justify it by the fact that the full test suite will be run once the hotfix is merged back into the main branch.) In any case, there should be enough auditing in place to ensure that 1: it's obvious to the whole team that a hotfix happened (to avoid malicious actors; this can be as easy as a Slack message on a public channel) and 2: that it's easy to figure out who performed the hotfix, when, and what was in the hotfix (for accountability & post-mortem tracking.)

15

u/mriforgot Oct 06 '26

At an old company of mine we had an Essential pipeline that ran a minimum of what were deemed absolutely critical tests and could deploy in under 20 minutes while the full suite ran in parallel. It made getting hotfixes out quick while also making sure that the full test suite wasn't just getting ignored.

8

u/shnutzer Oct 06 '26

Ideally you don't have to invent and there's a battle tested side-deployment path ready for you, but I won't cast any stones as I am not free of this sin myself

2

u/ITaggie Oct 06 '26

turn an emergency into a catastrophe

Surely you at least have backups... right?

4

u/Zeikos Oct 06 '26

I understand, but I prefer to fix the process rather than find ways to circumvent it.

30

u/WhenInDoubt_Kamoulox Oct 06 '26

Both, you do both.

You do the quick patch at 3am, then you go and fix the pipeline when you show up at work.

15

u/DeepDuh Oct 06 '26

you two are like this bell curve meme....

1

u/conundorum Oct 06 '26

This is the fix. You run the patch through the hotfix pipeline to keep everything alive long enough for the main line to finish pre-deployment testing. If everything is good, then the main line does everything except deployment (since the patch is already deployed); if something fails, then you know that the "hotfix" is a moth-eaten rag trying to plug a hole in the dam, and work on making a better fix before it bursts for real.

25

u/FluffyProphet Oct 06 '26

Sometimes engineering judgement and business needs have to win.

If this system being down is costing $5,000 a minute, the CI pipeline takes ~60 minutes to run, and I have a fix that I know works... but CI is failing because I didn't put a space after a comment, used an "any" to get the fix done quickly instead of building out the proper type... whatever, I want to just go to production. Hell, I probably want to skip a lot of checks on CI in the first place and get the system back up.

Then I can take the time in the morning, or direct someone else to, clean up the fix so it passes the entire CI pipeline.

I don't want to have to put in the incident report, "system was down for an additional 60 minutes because engineer forgot to put an extra new line after a comment".

-7

u/Zeikos Oct 06 '26 edited Oct 06 '26

Then put a fast track in the CI itself instead of creating a parallel system.
Those parallel systems tend to end up undocumented and used by a few "in the know".
I am not saying that how you do it is wrong, but the system we build should reflect the business needs.
This includes the aspect of how to manage emergencies.

7

u/Remote_Comfort_1981 Oct 06 '26

Fixing the pipeline and making it fast and 100% reliable is impossible. Trust me, I worked on CI/CD at a large listed company with whole teams working on CI and CD and we would only get CI to be 95% reliable at best. We even had automatic flake detection and isolation etc, but you just can't avoid people writing tests that fail 1% of time, or after some time, or only with some newer Docker base image because of an SSL bug...

4

u/Zeikos Oct 06 '26

Sure, but it's a continuous process.
Systemic failures should get fixed, because they hint at underlying issues.
The whole point of testing and logging errors is to have the information to do something about it.
It's the normal process of system hardening, right?

3

u/littlejerry31 Oct 06 '26

What's the business incentive to spend significant amount of money and reallocate manpower to fix and maintain something that works fine for the usual releases AND already has a solution for the hotfixes (the separate pipeline)?

As a fellow systems autist I understand your focus, but that's not how the business works.

1

u/Remote_Comfort_1981 Oct 10 '26

The underlying issue is constant change. It's also the one thing we are meant to support.

1

u/TimWasTakenWasTaken Oct 07 '26

Manager checkbox

1

u/LeJoker Oct 06 '26

I never understood why make CI/CD pipelines

I stopped reading your comment at this point, but I agree. Just don't make any mistakes in the code. It's easy.

3

u/myka-likes-it Oct 06 '26

Careless Integration / Careless Deployment

13

u/ArkWaltz Oct 06 '26

When I was at amazon, the internal pipeline tool had a big red "emergency deploy" button specifically for this situation. A big pipeline might (very deliberately) need days to reach all environments, so having the "ignore all that, just deploy this right now" button was a straight-up requirement.

7

u/ineyy Oct 06 '26

Runner failed

Device is busy

3

u/hagnat Oct 07 '26

> and that's why we have a separate tool for deploying hotfixes quickly

i call those separate tools "i ssh into the prod server and manually fix the code"

2

u/geofft Oct 06 '26

And now everything is called a hotfix :)

22

u/Last8Exile Oct 06 '26

The hook is kinda stupid because there is no way to fix that error normaly. You have to force push ci branch, altering history. The initial push should be rejected and ci is not triggered to run.

2

u/virtualdxs Oct 07 '26

And you should have a local commit-msg hook to catch it before the commit is even finalized, let alone pushed.

4

u/deadbeef4 Oct 06 '26

My favourite is when the lint check fails and it’s due to a comment not being wrapped at exactly the right point.

4

u/DogmaticParadigm87 Oct 06 '26

The linter has never been paged at 3am, and it shows.

6

u/Conroman16 Oct 06 '26

Dude if I got a pager duty alert and decided to make coffee first before looking at it instead of getting on immediately, I’d likely be fired. No wonder your manager was blowing you up.

42

u/OmegaPoint6 Oct 06 '26

Someone needs to turn on fail fast, or receive hooks

24

u/RodionGork Oct 06 '26

yep, such clever ideas generally come after incidents 😂

though things become harder when CI is governed by separate dedicated devops team etc

25

u/CatpainCalamari Oct 06 '26

"Missing empty line after commit message" could (and imho should) be caught by a local git hook thats rejects the push on your machine.

The rule itself might be stupid, but if it is mandatory and the pipeline tells you "nope" (but only after 30 min), you might save yourself some time and sanity by having a local fail fast check.

8

u/RodionGork Oct 06 '26

sure, that's all pretty correct - though it is always surprising why it is so hard to keep local hooks and CI rules consistent

especially on rules which are generally not violated, so generally no one can think such hook is necessary

9

u/ttlanhil Oct 06 '26

If it's set up as a server side hook, and there only, you no longer need to keep things in sync (if you have strong enough policy that client side always works, even better)

This is not the sort of thing CI should fail on - CI shouldn't need to care about source control (a pre-build script that checks commit messages, code style, etc - maybe - but by the time you start a build you should only care about code and config for the build)

3

u/RodionGork Oct 06 '26

> This is not the sort of thing CI should fail on 

actually some people prefer to setup automatic corrections for various minor issues on CI side (e.g. grooming the code style, fixing windows/unix newlines etc) - but some others find this inconvenient

1

u/Icarium-Lifestealer Oct 06 '26

Many people use CI in a broader sense, and include all the automatic checks that run on a PR before it gets merged.

3

u/ttlanhil Oct 06 '26

Okay, but even then - failure to build due to the commit message format after half an hour?