Skip to content

Commit

Permalink
manager: fix "unknown resources cleanup" traceback
Browse files Browse the repository at this point in the history
When a new on-demand pool is configured in pools.yaml, the cleanup logic
is typically executed before a new resource is started there, and thus
also before the database entry is created.

Fixes: #128
Fixes: #115
  • Loading branch information
praiskup committed Nov 5, 2023
1 parent e589711 commit 8b02e21
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions resallocserver/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,11 @@ def _clean_unknown_resources(self, event):

with session_scope() as session:
dbinfo = session.query(models.Pool).get(self.name)
if not dbinfo:
app.log.error("Can't perform cleanup in the configured "

This comment has been minimized.

Copy link
@praiskup

praiskup Nov 6, 2023

Author Owner

Let's switch to WARNING

"pool %s: no such pool in database.",
self.name)
return
last_cleanup = dbinfo.cleaning_unknown_resources
if last_cleanup is None:
last_cleanup = datetime.min
Expand Down

0 comments on commit 8b02e21

Please sign in to comment.