Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Large numbers of migrations lead to a message like
unable to retrieve applied migrations: unable to open file referencedata/sql/1650930505164-eq_rates_latlong_2decimals_v2-eq_rates_latlong_2decimals-219.sql: open referencedata/sql/1650930505164-eq_rates_latlong_2decimals_v2-eq_rates_latlong_2decimals-219.sql: too many open files
Our project has 6249 migrations. This fix allows such projects to work by limiting the number of active file descriptors opened. I was able to successfully run the apply operation on the 6249 without issue.
The patch reduces the performance on large runs (sample size my project) by approximately 27%. The average duration to run the migrations with the patch is 249 seconds. The average duration to run the present release of elwinar/rambler is 194 seconds, but can't be run a second time due to file descriptor exhaustion.