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

BlockingIdentifierGenerator invoked on wrong context under load #1595

Closed
tsegismont opened this issue Apr 17, 2023 · 3 comments · Fixed by #1608
Closed

BlockingIdentifierGenerator invoked on wrong context under load #1595

tsegismont opened this issue Apr 17, 2023 · 3 comments · Fixed by #1608

Comments

@tsegismont
Copy link
Contributor

In BlockingIdentifierGenerator, when a new block is allocated, invocations of generate method are queued:

queue.add( () -> generate( session, entity ).thenAccept( result::complete ) );

After the result is received, queued tasks are executed:

The problem is that they are executed on the Vert.x context which made the database call, not the context they were operating on when they were queued.

This explains the error logs in quarkusio/quarkus#32533

@Sanne
Copy link
Member

Sanne commented Apr 17, 2023

Excellent, thanks for investigating!
Seems related to #1587 : the problem is different but for both of them we'll need safety tests under load.

@Sanne
Copy link
Member

Sanne commented Apr 23, 2023

Fixed now, thanks again @tsegismont - this was really tricky

@tsegismont
Copy link
Contributor Author

You're welcome, I'm glad it helped

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 a pull request may close this issue.

2 participants