Janitor sometimes fails to clean up characters #391

Closed
opened 2025-01-04 12:24:22 -08:00 by scionaltera · 1 comment
scionaltera commented 2025-01-04 12:24:22 -08:00 (Migrated from github.com)

If the game shuts down while characters are still in it, and they are still in the database when it restarts, they appear as linkdead characters. The CharacterJanitor runs once per minute to clean those up, but I've noticed that it fails sometimes. The failure seems to be due to a foreign key on the location_component table still existing. My working theory at this point is that it is because the character is holding or wearing items. The cascading delete doesn't propagate to the items. Because the items aren't being deleted and they reference the character, the character cannot be deleted.

If the game shuts down while characters are still in it, and they are still in the database when it restarts, they appear as linkdead characters. The `CharacterJanitor` runs once per minute to clean those up, but I've noticed that it fails sometimes. The failure seems to be due to a foreign key on the `location_component` table still existing. My working theory at this point is that it is because the character is holding or wearing items. The cascading delete doesn't propagate to the items. Because the items aren't being deleted and they reference the character, the character cannot be deleted.
scionaltera commented 2025-01-05 21:16:21 -08:00 (Migrated from github.com)

Confirmed. If I enter the game and quit with nothing in my inventory it's fine. If I am holding or wearing something it throws an exception. The code for closing your browser and for being linkdead are essentially the same, just acting on different events. For the moment we could just drop any held/worn items on the floor?

Confirmed. If I enter the game and quit with nothing in my inventory it's fine. If I am holding or wearing something it throws an exception. The code for closing your browser and for being linkdead are essentially the same, just acting on different events. For the moment we could just drop any held/worn items on the floor?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
agony-forge/agonyforge#391
No description provided.