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

Fix race condition during updates #1690

Merged
merged 8 commits into from
Jun 30, 2023

Conversation

DavideD
Copy link
Member

@DavideD DavideD commented Jun 30, 2023

Fix #1687
Fix #1686

@DavideD DavideD requested a review from Sanne June 30, 2023 09:59
@DavideD DavideD force-pushed the 1687-fix-update-race-condition branch from df2133a to a4df639 Compare June 30, 2023 10:00
@DavideD DavideD mentioned this pull request Jun 30, 2023
Copy link
Member

@Sanne Sanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

@FroMage @franz1981 FYI we now have some variations of the Techempower stress tests included as integration tests within the Hibernate Reactive codebase, so at least the /updates endpoint logic is being tested upstream.
N.B. in this case we don't use Quarkus but vertx-web, so it's not exactly like what we use in Techempower but it should covers our bases here.

@Sanne Sanne changed the title Fix race condition during udpates Fix race condition during updates Jun 30, 2023
DavideD added 8 commits June 30, 2023 12:10
Hibernate ORM can use the same update coordinator among
multiple update operations.

In Hibernate Reactive, the reactive update coordinator
has a state that cannot be shared. So, we decided
to create a new scoped coordinator for each update
operation.

Right now, we want to merge a fix for the issue that
doesn't require us to copy or change code from
Hibernate ORM.

The plan is to find a more efficient solution as
a separate issue. And, possible add some
infrastructure to make it easier to track these
type of issues.
Remove warnings and refactor the createion of the test tasks
@DavideD DavideD force-pushed the 1687-fix-update-race-condition branch from a4df639 to eeb1954 Compare June 30, 2023 10:10
}

private Future<Product> getProduct(RoutingContext ctx) {
long id = Long.parseLong( ctx.pathParam( "id" ) );

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException

Potential uncaught 'java.lang.NumberFormatException'.

postRequests.add( send );
}
return all( postRequests );

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation

Invoking [CompositeFuture.all](1) should be avoided because it has been deprecated.
.deployVerticle( () -> new ProductVerticle( () -> sf ), deploymentOptions )
.map( ignore -> webClient )
.compose( this::createProducts )
.map( ignore -> webClient )

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'ignore' is never used.
.compose( this::createProducts )
.map( ignore -> webClient )
.compose( this::findProducts )
.onSuccess( res -> context.completeNow() )

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'res' is never used.
.deployVerticle( () -> new WorldVerticle( () -> sf ), deploymentOptions )
.map( ignore -> webClient )
.compose( this::createData )
.map( ignore -> webClient )

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'ignore' is never used.
.compose( this::createData )
.map( ignore -> webClient )
.compose( this::updates )
.onSuccess( res -> context.completeNow() )

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'res' is never used.
@Sanne Sanne merged commit de72329 into hibernate:main Jun 30, 2023
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

Successfully merging this pull request may close these issues.

Fix race condition during the update of multiple entites Add back integration tests with Vert.x
2 participants