-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Oracle XE container doesn't wait till database is ready / wait-strategy ignored #1292
Comments
Hey @nussbam, So this is kind of a bug (but also a legacy design in |
@kiview how to check a fix for the issue? All tests related to OracleContainer are ignored and i suppose it's related to Docker DMCA Takedown Notice. |
…ainers#1120) Bumps [HikariCP](https://github.com/brettwooldridge/HikariCP) from 3.2.0 to 3.3.0. <details> <summary>Commits</summary> - [`ec5e85e`](brettwooldridge/HikariCP@ec5e85e) [maven-release-plugin] prepare release HikariCP-3.3.0 - [`1744719`](brettwooldridge/HikariCP@1744719) Fixes [testcontainers#1305](https://github-redirect.dependabot.com/brettwooldridge/HikariCP/issues/1305) ensure that ConcurrentBag.add() does not spin under high load, wh... - [`1ac94f1`](brettwooldridge/HikariCP@1ac94f1) Fixes [testcontainers#1287](https://github-redirect.dependabot.com/brettwooldridge/HikariCP/issues/1287) when system property blockUntilFilled is set, use multiple thread... - [`4333989`](brettwooldridge/HikariCP@4333989) Fixes [testcontainers#1305](https://github-redirect.dependabot.com/brettwooldridge/HikariCP/issues/1305) ensure that ConcurrentBag.add() does not spin under high load, wh... - [`110f97e`](brettwooldridge/HikariCP@110f97e) Bump log4j.version from 2.9.0 to 2.11.1 ([testcontainers#1302](https://github-redirect.dependabot.com/brettwooldridge/HikariCP/issues/1302)) - [`d035231`](brettwooldridge/HikariCP@d035231) Bump mockito-core from 2.10.0 to 2.23.4 ([testcontainers#1301](https://github-redirect.dependabot.com/brettwooldridge/HikariCP/issues/1301)) - [`f0676c8`](brettwooldridge/HikariCP@f0676c8) Replace anonymous class with lambda ([testcontainers#1292](https://github-redirect.dependabot.com/brettwooldridge/HikariCP/issues/1292)) - [`50c3fd1`](brettwooldridge/HikariCP@50c3fd1) Call newInstance on Constructor of driverClass ([testcontainers#1290](https://github-redirect.dependabot.com/brettwooldridge/HikariCP/issues/1290)) - [`503a1d6`](brettwooldridge/HikariCP@503a1d6) Update README.md - [`45912eb`](brettwooldridge/HikariCP@45912eb) Fix unit test breakage. - Additional commits viewable in [compare view](brettwooldridge/HikariCP@HikariCP-3.2.0...HikariCP-3.3.0) </details> <br /> [![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=com.zaxxer:HikariCP&package-manager=gradle&previous-version=3.2.0&new-version=3.3.0)](https://dependabot.com/compatibility-score.html?dependency-name=com.zaxxer:HikariCP&package-manager=gradle&previous-version=3.2.0&new-version=3.3.0) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in the `.dependabot/config.yml` file in this repo: - Update frequency (including time of day and day of week) - Automerge options (never/patch/minor, and dev/runtime dependencies) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) Finally, you can contact us by mentioning @dependabot. </details>
…racleContainer class declaration
…od. Changed class declaration according.
If it helps any, there was an update on the wnameless repo:
|
I have a workaround for this. I subclassed @Override
protected void waitUntilContainerStarted() {
// wait for Oracle to be fully initialized
WaitStrategy waitStrategy = getWaitStrategy();
if (waitStrategy != null) {
waitStrategy.waitUntilReady(this);
}
// now, the JDBC connection should definitely work without lots of wasteful polling
super.waitUntilContainerStarted();
} Given our Oracle container was taking a long time to start up, and our wait strategy was for the Done message in the logs, I thought it would be sensible to prevent the JDBC polling until after the message appeared in the logs. For other wait strategies you might flip these round. Is it worth a PR on |
@kiview Now that oracle has an official container that anyone can easily build should we update the container wait strategy to look for the following output in logs?
If so let me know and I can work on delivering that. |
You are right, thanks for the pointer 👍 |
The oracle-xe container doesn't wait till the container signals its readiness with the
Database ready to use. Enjoy! ;)
-messageInstead it will wait till the
select 1 from dual
can be executed. Additionally wait-strategy that is set seems to be ignored.I tried setting a not fulfilling waiting strategy like:
However the application still continued regardless, after
select 1 from dual
could be executed.Since the db is not completely ready at this point I get broken connections in my Hikari-Pool:
Here the stacktrace:
Sometimes I also get:
If I manually implement
Wait.forLogMessage
like this:Then I don't have any connection issues anymore
The text was updated successfully, but these errors were encountered: