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

Sessions not being reused when having multiple concurrent requests #110

Open
earamizu opened this issue Mar 15, 2021 · 0 comments
Open

Sessions not being reused when having multiple concurrent requests #110

earamizu opened this issue Mar 15, 2021 · 0 comments

Comments

@earamizu
Copy link

earamizu commented Mar 15, 2021

Describe the bug
Requests being made almost concurrently are not seeing each other's sessions connected to FMS causing it to use the same session. For example, we have a button on a page that triggers a hook on FM that waits for 5 seconds. When there's no existent client and we click on this button twice, we see it creating and reusing the new client, but only the last session is being saved to the database (We're using NeDB for this). Once both calls come back, if we click on the button twice again, we'll see that both requests were done using the same session, therefore, running the requests sequentially.

Expected behavior
Sessions being used updated on the fly on the database (NeDB) so if a new request comes in, it would see that the current session is being used and it would create a new one for this new request so it would run the requests concurrently.

Tests
Following are some logs that we can see this issue.

First two calls (no client object saved to the database):

dapiClient id: YOAmXDfqSfs4TGsw
Concurrency: 5
Total Sessions: 1
Sessions:
0: 3bce0ff2-ec9f-4dc0-8d44-d7e628482d7b     active: false
/script_625: 5547.687ms
dapiClient id: YOAmXDfqSfs4TGsw
Concurrency: 5
Total Sessions: 1
Sessions:
0: 0cbd5ac1-1005-4db9-8b54-04011d16d55e     active: false
/script_538: 5536.370ms

Following calls:

dapiClient id: YOAmXDfqSfs4TGsw
Concurrency: 5
Total Sessions: 1
Sessions:
0: 0cbd5ac1-1005-4db9-8b54-04011d16d55e     active: false
/script_124: 5107.766ms
dapiClient id: YOAmXDfqSfs4TGsw
Concurrency: 5
Total Sessions: 1
Sessions:
0: 0cbd5ac1-1005-4db9-8b54-04011d16d55e     active: false
/script_311: 9710.650ms
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

No branches or pull requests

1 participant