Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many open file on spring application start #1449

Closed
pmancaux opened this issue Oct 2, 2020 · 7 comments
Closed

Too many open file on spring application start #1449

pmancaux opened this issue Oct 2, 2020 · 7 comments
Labels
DBPostgres hacktoberfest a month-long celebration of open-source software and Developers contribute by completing PRs ImpactMedium IntegrationSpringboot Severity3 TypeBug

Comments

@pmancaux
Copy link

pmancaux commented Oct 2, 2020

Environment

Liquibase Version:
4.0.0

Liquibase Integration & Version: <Pick one: CLI, maven, gradle, spring boot, servlet, etc.>
Spring

Liquibase Extension(s) & Version:

Database Vendor & Version:
Postgres 12

Operating System Type & Version:
Ubuntu 18.04 or linux with kernel 3.10.0-862.14.4.el7.x86_64

Description

When i upgrade from 3.8.1 to 4.0.0 i see Too many open file when i start my application.

What i see is a change in SpringLiquibase when createLiquibase is done. method createResourceOpener in 3.8.1 is

/**
	 * Create a new resourceOpener.
	 */
	protected SpringResourceOpener createResourceOpener() {
		return new SpringResourceOpener(getChangeLog());
	}

and in 4.0.0 become :

/**
	 * Create a new resourceOpener.
	 */
	protected SpringResourceAccessor createResourceOpener() {
		return new SpringResourceAccessor();
	}

The fact is when method DatabaseChangeLog.load is call, espacially this part of code :

for (ParsedNode childNode : parsedNode.getChildren()) {
            handleChildNode(childNode, resourceAccessor);
        }

when childNode.nodeName is equal to "include", code is loading/accessing all jar of my application and if i do lsof -p [PID] | wc -l on my system i can see that it pass from 500 to 1200 to 1500 to 2000 very rapidly and at the end of this foreach to 200.

If i come back to 3.8.1 i can see that lsof | wc -l is always equals to 500 and never grow up.

I don't understand why we search in all jar of the application for an include node when relativetochangelog is set to true, we just need to search only in this jar, not all?

Steps To Reproduce

with liquibase 3.8.1
create à changelog with many include like this :

and see lsof -p [PID] | wc -l on the filesystem

do the same with liquibase 4.0.0 and you will see the difference.

@molivasdat molivasdat added DBPostgres ImpactMedium IntegrationSpringboot Severity3 TypeBug hacktoberfest a month-long celebration of open-source software and Developers contribute by completing PRs labels Oct 6, 2020
@molivasdat
Copy link
Contributor

Thank you @pmancaux for writing up this issue. We will add this to our list of issues to process.

@pmancaux
Copy link
Author

@molivasdat any news about this issue? i m doing upgrade of my lib every 3 month but i can t go to 4.0.0 for now thanks

@pmancaux
Copy link
Author

pmancaux commented Feb 1, 2021

@molivasdat just for any news if you have :) thanks!

@ro-rah
Copy link

ro-rah commented Feb 1, 2021

This has been reported in 3.10.3 as well:
https://forum.liquibase.org/t/too-many-open-files-error-when-upgrading-to-3-10-3/5014

@molivasdat
Copy link
Contributor

Hi @pmancaux and @ro-rah . I have not had a chance to repro this issue. If you have a suggested fix, go ahead and open up a PR to suggest a fix. In the meantime, I'll see if I can track down why the change was made.

@nvoxland
Copy link
Contributor

Duplicate of #1815

@nvoxland nvoxland marked this as a duplicate of #1815 May 21, 2021
@nvoxland
Copy link
Contributor

Since this is a duplicate, I'm closing this issue to consolidate tracking and discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DBPostgres hacktoberfest a month-long celebration of open-source software and Developers contribute by completing PRs ImpactMedium IntegrationSpringboot Severity3 TypeBug
Projects
None yet
Development

No branches or pull requests

4 participants