Giter Club home page Giter Club logo

Comments (4)

xsalefter avatar xsalefter commented on July 28, 2024 1

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

  1. Update oss-parent to have embedded-postgres and add <jooq.version />, sent PR
  2. While waiting PR in [1], test embedded-postgres against killbill locally with modified killbill-commons using server from embedded-postgres instead of airlift.
  3. While testing in [2], work on fork of mysql-testing-server, and test against killbill-stripe-plugin
  4. Test work on [3] against killbill with modified killbill-commons using server from our mysql-testing-server instead of airlift.

B. When everything passed:

  1. Make sure that our mysql-testing-server is available at least in sonatype.

  2. 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.

  3. Update killbill-commons, killbill-platform to use latest oss-parent, test them (Do not send PR yet)

  4. Test killbill

  5. Test our stripe and braintree plugins

C. When everything passed

  1. Send PR for killbill-commons and killbill-platform with latest oss-parent.
  2. Update killbill, stripe-plugin, and braintree-plugin with latest oss-parent, and send PR

from killbill-oss-parent.

xsalefter avatar xsalefter commented on July 28, 2024

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.

xsalefter avatar xsalefter commented on July 28, 2024

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.

xsalefter avatar xsalefter commented on July 28, 2024

Done.

from killbill-oss-parent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.