Application to demonstrate random connection reset in GCP.
This is a simple application consisting of two HTTP endpoints where the first endpoint invokes the second, via a Load Balancer when running in GCP, and the second endpoint does some queries to a DB.
The purpose is to generate some traffic to trigger the random connection reset bug.
Run locally:
$ ./mvnw package
$ docker-compose up
Invoke the endpoints:
$ curl -v http://localhost:8080/demo/first
- Create a Storage Bucket to store the terraform state, and update in
infra/backend.tf
- Enter values in
infra/env.tfvars
- Run the following commands:
$ ./mvnw package -Ddocker.arch=amd64
$ docker tag demo:latest $DOCKER_REPOSITORY/demo:latest
$ docker push $DOCKER_REPOSITORY/demo:latest
$ cd infra
$ terraform apply --var-file env.tfvars
- Set up a DNS record for the domain to point to the LB IP
Invoke the endpoints:
$ curl -v https://$DOMAIN/demo/first
while true; do
sleep $[ ( $RANDOM % 3 ) + 1 ]s
curl -v https://demo.dev.veritru.me/demo/first
sleep $[ ( $RANDOM % 30 ) + 1 ]s
curl -v https://demo.dev.veritru.me/demo/first
sleep $[ ( $RANDOM % 300 ) + 1 ]s
curl -v https://demo.dev.veritru.me/demo/first
done