Skip to content

Bug when we scale up the app with Docker #3

Description

@mi2shiii

In page 402, we can scale up the app using the blow command:

docker-compose up --scale multiplication=2 --scale gamification=2

This is my result of calling leaderboard api ( http :8000/leaders) before and after scaling up the project:

Before:

Mahdis-MacBook-Pro:LearningMicroServices-v2-update-2.4.0-master mahdishabani$ http :8000/leaders
HTTP/1.1 200 OK
Content-Type: application/json
Date: Sun, 04 Apr 2021 08:35:48 GMT
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
transfer-encoding: chunked

[
{
"badges": [
"First time"
],
"totalScore": 10,
"userId": 1
}
]

And After scaling up , each time I got different response:

First call:

Mahdis-MacBook-Pro:LearningMicroServices-v2-update-2.4.0-master mahdishabani$ http :8000/leaders
HTTP/1.1 200 OK
Content-Type: application/json
Date: Sun, 04 Apr 2021 09:09:47 GMT
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
transfer-encoding: chunked

[]

Second Call:

Mahdis-MacBook-Pro:LearningMicroServices-v2-update-2.4.0-master mahdishabani$ http :8000/leaders
HTTP/1.1 200 OK
Content-Type: application/json
Date: Sun, 04 Apr 2021 09:14:29 GMT
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
transfer-encoding: chunked

[
{
"badges": [
"First time"
],
"totalScore": 10,
"userId": 1
}
]

Third call:

Mahdis-MacBook-Pro:LearningMicroServices-v2-update-2.4.0-master mahdishabani$ http :8000/leaders
HTTP/1.1 200 OK
Content-Type: application/json
Date: Sun, 04 Apr 2021 09:14:29 GMT
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
transfer-encoding: chunked

[
{
"badges": [
"First time"
],
"totalScore": 10,
"userId": 1
}
]

Screenshot 2021-04-04 at 13 45 50

Screenshot 2021-04-04 at 13 45 45

Screenshot 2021-04-04 at 13 45 36

You can see each time I refresh the page, I got a different result.

This problem just happens when I scaled up the project. Before scaling up, everything was stable and consistent.

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions