Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timeout when sending mail about orphaned users #615

Closed
baszoetekouw opened this issue Apr 3, 2023 · 1 comment
Closed

timeout when sending mail about orphaned users #615

baszoetekouw opened this issue Apr 3, 2023 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@baszoetekouw
Copy link
Member

We enabled the orphaned_users cronjob, which was suppossed to remove a few hundred (~350) users last Saturday.

The users seems to have bene removed, but the mail recording this was never sent:

Apr 01 03:02:50 sbs-pf1 postfix/smtpd[333879]: connect from localhost[127.0.0.1]
Apr 01 03:07:51 sbs-pf1 postfix/smtpd[333879]: timeout after EHLO from localhost[127.0.0.1]

Could it be that rendering the template https://github.com/SURFscz/SBS/blob/main/server/templates/orphan_user_delete.txt takes too much time?

In any case, this is rather annoying as we now have no record of which orphaned users where removed.

I propose the following changes:

  • first render the templates, and only after that start the connection to the mail server.
  • determine why rendering take so long. Maybe it helps if we only pass a list ofUser.uids to the templating engine, instead of a list of User objects? I can imagine those being rather bulky.
  • Handle retrying mail sending if the first attempt fails. Maybe try up to five times, and if that fails dump the mail content to the logs.
  • output the (uids of the) users who have been deleted to the log
@baszoetekouw baszoetekouw added the bug Something isn't working label Apr 3, 2023
@oharsta oharsta closed this as completed in 48908ff Apr 3, 2023
oharsta added a commit that referenced this issue Apr 4, 2023
@baszoetekouw baszoetekouw added this to the v22 milestone Apr 12, 2023
@baszoetekouw
Copy link
Member Author

Tested. Orphaning 400 users now takes 1300ms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants