Skip to content

Lift INPI RNE account rejections once INPI is back - #488

Merged
skelz0r merged 2 commits into
developfrom
feature/inpi-401-outage
Oct 9, 2026
Merged

skelz0r merged 2 commits into
developfrom
feature/inpi-401-outage

Conversation

@skelz0r

@skelz0r skelz0r commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

On 2026-10-09 INPI was down and answered 401 on login between 07:15 and 07:55 UTC although our passwords were valid. Both production accounts were rejected for 24 hours, so production kept rendering an INPI RNE maintenance error after INPI came back, while the ping, which uses its own accounts, was green again.

The first commit stores the rejections in Redis outside the cache namespace that changes on every boot, so all processes share them: each process no longer needs its own 401 before skipping an account, and a rejection can be lifted for everyone. A deploy no longer lifts them.

The second commit uses the INPI RNE pings when both accounts are rejected: if one succeeded after the last rejection, a single request retries the accounts while the others stay in maintenance, and the rejections are lifted only once a login works. Otherwise we stay in maintenance. If both production passwords really expire while the ping accounts work, each ping success costs one more 401 per account, which is rare and visible in Sentry.

@skelz0r skelz0r self-assigned this Oct 9, 2026
During the INPI outage of 2026-10-09, each server process had its own
copy of the rejected accounts: the cache namespace changes on every
boot, and two processes booted one second apart held the same rejected
accounts under two different namespaces. Each process had to get its
own 401 before skipping an account, so INPI received more failed
logins than needed, and nothing could lift a rejection for all
processes at once.

Rejections are now stored in Redis outside the cache namespace, like
the ping last success dates, so every process sees the same ones. A
deploy no longer lifts them: they last their full 24 hours unless
lifted explicitly.
On 2026-10-09, INPI was down and answered 401 on login between 07:15
and 07:55 UTC although our passwords were valid. Both production
accounts were rejected for 24 hours, so production kept answering
with an INPI RNE maintenance error long after INPI came back, while
the ping, which uses its own accounts, was green again.

When both accounts are rejected, we now look at the INPI RNE pings: if
one succeeded after the last rejection, INPI is back and the accounts
are tried again. Otherwise we stay in maintenance as before.

Only one request retries per ping success, the others stay in
maintenance meanwhile, and rejections are lifted only once a login
works: several requests retrying at the same time would multiply the
401 that get our IP banned. Rejection times keep sub-second precision
so that a ping earlier in the same second does not count as later.

If both production passwords really expire while the ping accounts
still work, each new ping success costs one 401 per account. This is
rare and shows up in Sentry, which is better than a full day of
maintenance after every INPI outage.

Covered: no ping success since the rejections, a ping earlier in the
same second, recovery, accounts usable again afterwards, a concurrent
request during the retry, and expired passwords tried once per ping
success. Not covered: Redis errors while retrying, which leave the
accounts usable, as before this branch.
@skelz0r
skelz0r force-pushed the feature/inpi-401-outage branch from 4db8229 to 6485111 Compare October 9, 2026 09:11
@skelz0r
skelz0r requested a review from Un3x October 9, 2026 09:11

@Un3x Un3x left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je suis médusé par tout ce système en place.

C'est ok, mais j'ai pas envie de faire ca pour chaque FD

@skelz0r

skelz0r commented Oct 9, 2026

Copy link
Copy Markdown
Member Author

C'est ok, mais j'ai pas envie de faire ca pour chaque FD

Ah bah moi non plus hein 😅

@skelz0r
skelz0r merged commit 06550e3 into develop Oct 9, 2026
9 checks passed
@skelz0r
skelz0r deleted the feature/inpi-401-outage branch October 9, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants