What is a ForkFlowException and why am I receiving it?

We have been seeing a few ForkFlowException in our logs.

It seems to be thrown here: keycloak/services/src/main/java/org/keycloak/authentication/DefaultAuthenticationFlow.java at 25.0.6 · keycloak/keycloak · GitHub. The lines around the code make it look as if this is expected.

What is a fork? There is also this explanation here: keycloak/server-spi-private/src/main/java/org/keycloak/authentication/FlowStatus.java at 25.0.6 · keycloak/keycloak · GitHub. However, I fail to understand it in the context of our application.

Also this explanation here: keycloak/server-spi-private/src/main/java/org/keycloak/authentication/AuthenticationFlowContext.java at 25.0.6 · keycloak/keycloak · GitHub.

Could perhaps someone give an example user flow of how I would end up with this exception?

See my duplicate post here: Need some help understanding `ForkFlowException`, please! · keycloak/keycloak · Discussion #34945 · GitHub.

I was able to reproduce the issue.

It happens when a user clicked forgot password, changed her password and then clicked forgot password again.

Now I understand how, but still not why.