Skip to content

Conversation

@geoand
Copy link
Contributor

@geoand geoand commented May 22, 2020

This PR essentially takes the substitution we had for native mode
and turns it into a class transformer.
This way even in JVM mode our Flyway integration take advantage of
the fact that the migration script locations are known at build time,
thus no classpath scanning is needed.

This solution isn't ideal from a maintenance perspective, but the
transformation is relatively straightforward and our test suite for
Flyway pretty extensive, so we should easily be able to adapt to future
Flyway updates (ideally we would be able to remove this if /when
flyway/flyway#2822 is done)

Relates to: #9428

@geoand geoand force-pushed the speedup-flyway branch 2 times, most recently from 88b4953 to 937cb4d Compare May 22, 2020 11:58
@geoand
Copy link
Contributor Author

geoand commented May 22, 2020

It seems like our QuarkusPathLocationScanner doesn't work well on Windows, so I'll have to fix that as well.

@geoand geoand force-pushed the speedup-flyway branch 2 times, most recently from ba96126 to a5e9bdc Compare May 22, 2020 12:25
@geoand geoand changed the title Speedup Flyway by preventing it from doing classpath scanning WIP: Speedup Flyway by preventing it from doing classpath scanning May 22, 2020
@geoand geoand force-pushed the speedup-flyway branch 2 times, most recently from 9b35940 to e08dd3e Compare May 22, 2020 12:41
@boring-cyborg boring-cyborg bot added the area/infra-automation anything related to CI, bots, etc. that are used to automated our infrastructure label May 22, 2020
@geoand geoand force-pushed the speedup-flyway branch 4 times, most recently from b2416d3 to 5a1c57a Compare May 22, 2020 13:58
@geoand
Copy link
Contributor Author

geoand commented May 22, 2020

Windows issue fixed - PR is now ready

@geoand geoand changed the title WIP: Speedup Flyway by preventing it from doing classpath scanning Speedup Flyway by preventing it from doing classpath scanning May 22, 2020
@Sanne
Copy link
Member

Sanne commented May 22, 2020

hum.. it's a cool approach but it bothers me to set such a precedent.

Do we really want to "hot patch" libraries this way? If they are bad let them be bad.. or have them accept a patch?

I suppose there might be situations in which projects aren't reactive while we need a critical fix, but I'd rather us consider forking a project in such a case.

Did you send a PR? At least give them a chance..

@geoand
Copy link
Contributor Author

geoand commented May 22, 2020

@Sanne I share your concerns. I definitely wouldn't have done it had there been a better way.

Here is the ticket I opened at Flyway, but so far no response. I don't want to submit a PR there until they at least agree that it's something they want.

The reasons I went ahead with this PR here are:

  1. It's a relatively small monkey-patch that we can very easily take away when we have proper upstream support
  2. We can move so much faster than upstream
  3. We have people complaining about Flyway being slow :)

@geoand geoand added area/flyway and removed area/infra-automation anything related to CI, bots, etc. that are used to automated our infrastructure labels May 22, 2020
@Sanne
Copy link
Member

Sanne commented May 22, 2020

We have people complaining about Flyway being slow :)

Have people complain / contribute fixes to Flyway ? Are we going to fix and improve any project we integrate with?

@geoand
Copy link
Contributor Author

geoand commented May 22, 2020

Of course we can't fix everything, but some commonly used things we can, wouldn't you agree?

Moreover, this isn't just a simple speed up, it's, it brings the advantages of our powerful build time processing to the integration with a popular library.

@geoand
Copy link
Contributor Author

geoand commented May 22, 2020

I also need to mention that this monkey patch is the same one we already use for the native image.

@Sanne
Copy link
Member

Sanne commented May 22, 2020

Sure, good points @geoand . Don't take my comments as a negative review - just don't be surprised if you'll have to fix more bugs this way going forward :-P

@geoand
Copy link
Contributor Author

geoand commented May 22, 2020

I completely understand @Sanne and I definitely appreciate the scrutiny 👌

This PR essentially takes the substitution we had for native mode
and turns it into a class transformer.
This way even in JVM mode our Flyway integration take advantage of
the fact that the migration script locations are known at build time,
thus no classpath scanning is needed.

This solution isn't ideal from a maintenance perspective, but the
transformation is relatively straightforward and our test suite for
Flyway pretty extensive, so we should easily be able to adapt to future
Flyway updates (ideally we would be able to remove this if /when
flyway/flyway#2822 is done)

Relates to: quarkusio#9428
@geoand geoand merged commit 1b8200a into quarkusio:master May 25, 2020
@geoand geoand deleted the speedup-flyway branch May 25, 2020 04:19
@geoand geoand added this to the 1.6.0 milestone May 25, 2020
@gsmet
Copy link
Member

gsmet commented May 25, 2020

I'm leaning towards backporting this to 1.5 Final. @geoand WDYT?

@geoand
Copy link
Contributor Author

geoand commented May 25, 2020

It's should give a nice speed boost and given our extensive Flyway testsuite, I think it's safe

@sirAlexanderT
Copy link

Thanks @geoand for pushing this forward as I can see 'flyway' aren't being as responsive

@geoand
Copy link
Contributor Author

geoand commented May 25, 2020

You are welcome

@gsmet gsmet changed the title Speedup Flyway by preventing it from doing classpath scanning Speed up Flyway by preventing it from doing classpath scanning May 26, 2020
@gsmet gsmet modified the milestones: 1.6.0 - master, 1.5.0.Final May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants