hydra icon indicating copy to clipboard operation
hydra copied to clipboard

Janitor should clean up old finished flows

Open abador opened this issue 1 year ago • 2 comments

Preflight checklist

Describe your problem

At the moment janitor (in FlushInactiveLoginConsentRequests) cleans up the hydra_oauth2_flow for all states different than flow.FlowStateConsentUsed. This seems ok and cleans up any broken/unfinished flows. During our testing, we noticed that our database gets bloated and the data isn't flushed for short sessions/consents (combinations of consent_remember = 0|1, consent_remember_for = 0|60|3600, login_remember=0, login_remember_for=0 ). If I understand correctly those records could also be deleted. This also impacts hydra_oauth2_code and hydra_oauth2_oidc tables

Describe your ideal solution

An additional cleanup job is added that cleans up flows that have the state column equal to flow.FlowStateConsentUsed, but aren't valid anymore (no other tables rely on them anymore).

Workarounds or alternatives

Running own query that cleans up the tables. This is doable if you have the same settings for every client, but I don't see a valid solution that would clean it up properly in other setups

Version

2.1.1

Additional Context

No response

abador avatar Jun 29 '23 07:06 abador

Hello contributors!

I am marking this issue as stale as it has not received any engagement from the community or maintainers for a year. That does not imply that the issue has no merit! If you feel strongly about this issue

  • open a PR referencing and resolving the issue;
  • leave a comment on it and discuss ideas on how you could contribute towards resolving it;
  • leave a comment and describe in detail why this issue is critical for your use case;
  • open a new issue with updated details and a plan for resolving the issue.

Throughout its lifetime, Ory has received over 10.000 issues and PRs. To sustain that growth, we need to prioritize and focus on issues that are important to the community. A good indication of importance, and thus priority, is activity on a topic.

Unfortunately, burnout has become a topic of concern amongst open-source projects.

It can lead to severe personal and health issues as well as opening catastrophic attack vectors.

The motivation for this automation is to help prioritize issues in the backlog and not ignore, reject, or belittle anyone.

If this issue was marked as stale erroneously you can exempt it by adding the backlog label, assigning someone, or setting a milestone for it.

Thank you for your understanding and to anyone who participated in the conversation! And as written above, please do participate in the conversation if this topic is important to you!

Thank you 🙏✌️

github-actions[bot] avatar Jun 29 '24 00:06 github-actions[bot]

I'm also looking for a solution to clean up those tables.

Renkas avatar Jul 01 '24 16:07 Renkas