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

PUT request invoked on paused infinispan server will appear later when it is running again #15816

Closed
mirostary opened this issue Mar 17, 2021 · 4 comments
Labels
area/infinispan Infinispan kind/bug Something isn't working

Comments

@mirostary
Copy link
Contributor

mirostary commented Mar 17, 2021

If Quarkus application invokes a PUT request on the down Infinispan server, the request appears later when the server is running again.

The behavior is unexpected because the cache changes (or the request is processed) even after the client closed the connection, mainly it is a problem when running in OpenShift environment, where the request times out after 30 seconds (default setting openshift-router), and yet there this request remains and is processed after the Datagrid is connected (which may be beyond the control of the application administrator, eg. in case of disconnecting the node).

Steps to reproduce the behavior:
The first scenario
1.

$ git clone https://github.com/mirostary/simple-infinispan.git
$ cd simple-infinispan
$ docker run --rm -it --name simple-infinispan -e USER="test" -e PASS="test" -p 11222:11222 infinispan/server:latest
$ mvn clean install quarkus:dev
$ curl -X PUT http://localhost:8080/counter/increment-counters
$ curl -X GET http://localhost:8080/counter/get-client // 1
$ curl -X GET http://localhost:8080/counter/get-cache  // 1
$ docker pause simple-infinispan
$ curl -X PUT http://localhost:8080/counter/increment-counters
  1. It will get stuck but the "get-client" counter will be "2"
  2. Interrupt the PUT request
$ docker unpause simple-infinispan
$ curl -X GET http://localhost:8080/counter/get-cache // 2

The second scenario

The same steps 1, 2, 3, and then

$ curl -X GET http://localhost:8080/counter/get-cache
$ docker unpause simple-infinispan

the "get-cache" is 1
$ curl -X GET http://localhost:8080/counter/get-cache // 2
but when I call it again (without anything else) it is 2

@mirostary mirostary added the kind/bug Something isn't working label Mar 17, 2021
@quarkus-bot quarkus-bot bot added the area/infinispan Infinispan label Mar 17, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Mar 17, 2021

/cc @karesti, @wburns

@danberindei
Copy link

@mirostary I added a comment on https://issues.redhat.com/browse/QUARKUS-876

The gist of it is you're suspending the Infinispan server container, but the connection you're interrupting is from curl to the simple-infinispan application, and the interruption doesn't stop the application from doing whatever it started to do with the server.

@mirostary
Copy link
Contributor Author

@danberindei Thank you for the explanation, We've configured a hotrod client. Since this an expected behavior, It may be good to add more about this to the documentation Quarkus - Infinispan Client. It could prevent some problems, for example in OpenShift, there are the request times in default out after 30 seconds.

@karesti karesti closed this as completed Jan 2, 2023
@karesti
Copy link
Member

karesti commented Jan 2, 2023

QUARKUS-876 is was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/infinispan Infinispan kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants