Task failure without event handlers prevents proper resource cleanup
warningResource ContentionUpdated Mar 8, 2017(via Exa)
Technologies:
How to detect:
When tasks that allocate costly resources (e.g., AWS EC2 clusters) fail without implementing event handlers, cleanup operations may not execute, potentially leaving resources in an allocated or dirty state
Recommended action:
Implement event handlers using @luigi.Task.event_handler decorator for FAILURE, SUCCESS, and other events. Place cleanup logic (resource deallocation, connection closure, etc.) in these handlers to ensure execution regardless of task outcome. Example: @luigi.Task.event_handler(luigi.Event.FAILURE) def handler_failure(self, exception): # do cleanups