jointakahe / takahe

An ActivityPub/Fediverse server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blocked Domains trying to transition from updated to updated

humrochagf opened this issue · comments

Hello, I noticed that now that we don't try to comunicate with blocked domains aac75dd and 83b57a0 the blocked domains are trying to go from outdated to outdated and failing during this transition.

takahe-stator-1  | Traceback (most recent call last):
takahe-stator-1  |   File "/takahe/stator/runner.py", line 238, in clean_tasks
takahe-stator-1  |     task.result()
takahe-stator-1  |   File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 449, in result
takahe-stator-1  |     return self.__get_result()
takahe-stator-1  |            ^^^^^^^^^^^^^^^^^^^
takahe-stator-1  |   File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
takahe-stator-1  |     raise self._exception
takahe-stator-1  |   File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
takahe-stator-1  |     result = self.fn(*self.args, **self.kwargs)
takahe-stator-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
takahe-stator-1  |   File "/takahe/stator/runner.py", line 268, in task_transition
takahe-stator-1  |     result = instance.transition_attempt()
takahe-stator-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
takahe-stator-1  |   File "/takahe/stator/models.py", line 216, in transition_attempt
takahe-stator-1  |     raise ValueError(
takahe-stator-1  | ValueError: Cannot transition users.domain: blob.cat: from updated to updated - not a declared transition

Btw, I edited the error message code locally to show the target of the failure.

I'm not yet super familiar with the underlying stator code, so I'm not sure if this is caused by a race condition or other issue but I noticed that checking the domains after the error its state keeps as updated, but the state_next_attempt is not incremented so it keeps failing again periodically.

Just figured it out, the handle_updated was breaking the stator flow, I presised it in the PR above 😄

Actually, I think the right solution here is to allow that transition - I deliberately didn't want to move to outdated so that someone reading the logs might think we were communicating. Doing the transition will reset the timer to 7 days again, as well, so it shouldn't busy loop.

So, how to block it from failing and also to be constantly queued in the stator loop? Implement an updated to updated transition and send the next check to datetime max value? But also then if we need to unblock a domain, should we reset the date?

Ah ok got it. Accept the update to go through so the timer bumps 7 days, I'll follow this way.

Done, I reverted the change and allowed the updated to updated to happen 😃