SQLFileChange uses too many file descriptors

Description

SQLFileChange opens file streams and leaves them open while processing. The number of SQL files that can be used in a change set is limited by the number of file descriptors available. On Linux, the default maximum open file limit (ulimit -n) is 1024. Once the open file limit is reached, Liquibase return a non-descriptive error:
liquibase.exception.SetupException: <sqlfile path=source/mySql.sql> - Could not find file

SQLFileChange should close the input stream when the SQL string is loaded into memory.

Environment

Linux-64 (rhel6)

Status

Reporter

Pablo Depietri

Components

Fix versions

Affects versions

Priority

Blocker
Configure