The after_script behavior

I can't understand the after_script behaviour.

The documentation says, that after_script runs in clear context always even job failed.

Why is this needed? I have no need to execute after_script, for example, via docker executor even after_script not defined.

Life example:

DbJob:
  image: database-client
  variables:
    db_pass: supersecret

When db_pass is setted, entrypoint triggered to re-initialize database. This is good, but ... In gitlab ci with after_script we have another one reinitialization. This is very important when this is a remote database and in my example it clear database state.

I found 3-years old opened issue with this pain and people still wait for answer. Can You explain me, why You did this behavior? It's absoluttely unusable and unpredictable 'feature' (look at ansible pre_tasks, tasks, post_tasks, and resque/finally).

I'm absolutely don't understand why after_script running even no after_script section was defined.

Thank you very much, if you read that