Comments (4)
We going to 2 different paths:
- for postgres, we use zonkyio's emdedded postgre.
- we will fork Airlift's
testing-mysql-server
.
Update plan:
A. Initial Work
- Update oss-parent to have
embedded-postgres
and add <jooq.version />, sent PR - While waiting PR in [1], test
embedded-postgres
against killbill locally with modifiedkillbill-commons
using server from embedded-postgres instead of airlift. - While testing in [2], work on fork of
mysql-testing-server
, and test againstkillbill-stripe-plugin
- Test work on [3] against
killbill
with modifiedkillbill-commons
using server from ourmysql-testing-server
instead of airlift.
B. When everything passed:
-
Make sure that our
mysql-testing-server
is available at least in sonatype. -
Update
oss-parent
:- Remove all airlift dependencies
- Add our
mysql-testing-server
- Start to upgrade JOOX version to 3.15.x
and wait until available in sonatype.
-
Update
killbill-commons
,killbill-platform
to use latestoss-parent
, test them (Do not send PR yet) -
Test
killbill
-
Test our stripe and braintree plugins
C. When everything passed
- Send PR for
killbill-commons
andkillbill-platform
with latestoss-parent
. - Update
killbill
,stripe-plugin
, andbraintree-plugin
with latestoss-parent
, and send PR
from killbill-oss-parent.
Update in Fork vs testcontainers
:
Fork
At least for postgresql, we need to download binary from enterprisedb. Page in enterprisedb show that we have limited postgreSQL binary. At the time of writing, only postgresql v.10.22 that is available for linux. fetch ... row only
supported by postgresql 10, but if we want to go with postgresql > v.10.22, we may need to build it from source.
Testcontainers
TD;LR: Testcontainers need docker-machine
, but officially, docker-machine deprecated a year ago. There are fork by rancher and gitlab. There's also request to remove docker in testcontainers.
from killbill-oss-parent.
Known Embedded Postgres issue (When integrating with Killbill)
A lot of stacktrace after unexpected exception
When running slow
test in killbill
(with using embedded-postgres
in killbill-commons
), I encounter this exception:
....
[ERROR] Tests run: 755, Failures: 1, Errors: 0, Skipped: 754, Time elapsed: 5.081 s <<< FAILURE! - in TestSuite
[ERROR] org.killbill.billing.jaxrs.TestPerTenantConfig.beforeSuite Time elapsed: 4.512 s <<< FAILURE!
java.lang.NoClassDefFoundError: javax/annotation/Priority
at org.glassfish.jersey.model.internal.RankedProvider.computeRank(RankedProvider.java:87)
at org.glassfish.jersey.model.internal.RankedProvider.<init>(RankedProvider.java:48)
at org.glassfish.jersey.internal.inject.Injections.lookupService(Injections.java:89)
....
That's the real problem that need to tackle, but after that, there's a lot of stacktrace that coming up after. That stacktrace showing up more than 800 times that it is cluttered and make it hard to find what is the real problem.
Seems like It is works as intended (shutdown database and fail-fast), but ~800 attempt to get connection may indicating that fail-fast not archived properly.
Below is one of them:
....
2022-10-14T21:04:35,712+0000 lvl='WARN', log='DefaultQueueLifecycle', th='notifications-lifecycle-dispatcher-th-1', xff='', rId='', tok='', aRId='', tRId='', notifications:
Thread notifications-lifecycle-dispatcher-th-1 got DBIException exception:
org.skife.jdbi.v2.exceptions.UnableToObtainConnectionException: org.postgresql.util.PSQLException: Connection to localhost:37747 refused.
Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
at org.skife.jdbi.v2.DBI.open(DBI.java:251)
at org.skife.jdbi.v2.DBI.open(DBI.java:219)
at org.skife.jdbi.v2.DBI.withHandle(DBI.java:300)
at org.skife.jdbi.v2.DBI.inTransaction(DBI.java:328)
at org.killbill.queue.DBBackedQueue.executeTransaction(DBBackedQueue.java:343)
at org.killbill.queue.DBBackedQueueWithPolling.getReadyEntries(DBBackedQueueWithPolling.java:71)
at org.killbill.notificationq.NotificationQueueDispatcher.getReadyNotifications(NotificationQueueDispatcher.java:287)
at org.killbill.notificationq.NotificationQueueDispatcher.doDispatchEvents(NotificationQueueDispatcher.java:217)
at org.killbill.queue.DefaultQueueLifecycle.withHandlingRuntimeException(DefaultQueueLifecycle.java:367)
at org.killbill.queue.DefaultQueueLifecycle$DispatcherRunnable.run(DefaultQueueLifecycle.java:301)
at org.killbill.commons.concurrent.WrappedRunnable.run(WrappedRunnable.java:49)
....
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.postgresql.util.PSQLException: Connection to localhost:37747 refused.
Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:319)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:247)
at org.postgresql.Driver.makeConnection(Driver.java:434)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228)
at org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:103)
at org.killbill.billing.DBTestingHelper$RetryableDataSource.getConnection(DBTestingHelper.java:130)
at org.skife.jdbi.v2.DataSourceConnectionFactory.openConnection(DataSourceConnectionFactory.java:40)
at org.skife.jdbi.v2.DBI$4.execute(DBI.java:230)
at org.skife.jdbi.v2.DBI$4.execute(DBI.java:227)
at org.killbill.commons.profiling.Profiling.executeWithProfiling(Profiling.java:35)
at org.skife.jdbi.v2.DBI.open(DBI.java:227)
... 15 common frames omitted
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
at java.base/java.net.Socket.connect(Socket.java:591)
at org.postgresql.core.PGStream.createSocket(PGStream.java:241)
at org.postgresql.core.PGStream.<init>(PGStream.java:98)
... 30 common frames omitted
from killbill-oss-parent.
Done.
from killbill-oss-parent.
Related Issues (20)
- Upgrade Metrics to 4.2.x
- Upgrade Flyway
- Upgrade Jooby HOT 1
- Investigate alternative HTTP client HOT 1
- Problems building in IntelliJ IDEA 2021.1 HOT 1
- Java 16 support HOT 2
- Upgrade osgi dependencies HOT 5
- Switch to jakarta namespace HOT 3
- Updating Jooq to 3.14.0+ throw runtime error in MySQL HOT 1
- Review 2022 dependabot configuration HOT 2
- update postgresql test server to embedded postgres HOT 1
- fork airlift testing-mysql-server
- update various github ci configuration
- Reassess Redis integration
- Update snakeyaml dependency version HOT 2
- make some release steps automatic HOT 4
- Upgrade Stringtemplate to v4
- Upgrade the log4jdbc dependency
- Review maven-clean-plugin usage HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from killbill-oss-parent.