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

Running DB with dump in Spring using Managedprocess #882

Open
TheUnlimited64 opened this issue Feb 5, 2024 · 1 comment
Open

Running DB with dump in Spring using Managedprocess #882

TheUnlimited64 opened this issue Feb 5, 2024 · 1 comment

Comments

@TheUnlimited64
Copy link

TheUnlimited64 commented Feb 5, 2024

I am currently utilizing your library to perform a specific task: fixing a .sql file and subsequently creating a dump of the fixed file. I am initiating my application via CommandLineRunner and starting the database with the .start() method, followed by running my code.

However, I am encountering an issue when attempting to wait for mysqldump to complete. Here is the code snippet I am using:

ManagedProcess managedProcess = db.dumpSQL(file, "smdb", "root", "1234").start();
        managedProcess.waitForExit();

When I attempt to call .waitForExit(), the execution seems to halt indefinitely. It appears as though the program is freezing, and no further execution occurs.

My hypothesis is that the .waitForExit() method might be blocking the main thread where the database is running, potentially leading to a deadlock situation. This is based on the observation that the main thread seems to be unresponsive during the waitForExit() call.

Unfortunately, it seems that I have limited control over the ManagedProcess instance, which makes it challenging to troubleshoot or circumvent this issue.

I am seeking your assistance to understand this behavior better and, if possible, find a solution. Could you please provide guidance on how to safely start the database, create a dump, and wait for the dump process to finish without causing a deadlock or freezing the main thread?

@vorburger
Copy link
Collaborator

Which version of MariaDB4j are you using?

It's difficult to tell what exactly is going on based only on the description above. Would you be willing to post a full log?

If you use MariaDB4j professionally, please consider to, either:

to support future maintenance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants