Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
dcache-chimera: fix cleaner batch delete exception
Motivation: Deleting files by DiskCleaner is done via a database batch update, which throws the following exception when the list happens to be empty: `java.util.concurrent.CompletionException: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [DELETE FROM t_locationinfo_trash WHERE ilocation=? AND ipnfsid=? AND itype=1]; nested exception is java.sql.SQLException: statement is not in batch mode`. Modification: Pass an immutable delete file list copy to the batch delete method to make sure that it is not modified in the meantime. Check that the list is not empty in the batch delete method. Result: Reduced likelihood of `SQLException: statement is not in batch mode` in DiskCleaner. Target: master Request: 8.0 Request: 7.2 Request: 7.1 Request: 7.0 Request: 6.2 Fixes: #6496 Requires-notes: no Requires-book: no Patch: https://rb.dcache.org/r/13455/ Acked-by: Tigran Mkrtchyan
- Loading branch information