-
Notifications
You must be signed in to change notification settings - Fork 119
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
fiberi18n error on concurrent requests #594
Comments
@Skyenought can you help here |
let me see. |
I will be making a pull request to fix the known issues |
@Skyenought I got the code from master branch but when I run the request concurrently, the system still gives i18n error
|
@tran-the-lam show your code ? |
had you read article -> https://docs.gofiber.io/#zero-allocation |
You can see my demo(https://github.com/tran-the-lam/debug-fiberi18n)
|
here you should do a copy |
I tried but response still same error
|
Maybe gofiber/contrib/fiberi18n has the same problem Line 85 in 2bad1b1
|
problem is that you store the value in a map which survives longer than the request response loop, so you should make a copy here with our copy function |
@Skyenought same problem is here we need better unittests |
yes, i will |
In fact, although I didn't use methods like |
In fact, I used > ab -n 1000 -c 50 http://127.0.0.1:3000/
This is ApacheBench, Version 2.3 <$Revision: 1843412 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests
Server Software:
Server Hostname: 127.0.0.1
Server Port: 3000
Document Path: /
Document Length: 5 bytes
Concurrency Level: 50
Time taken for tests: 0.021 seconds
Complete requests: 1000
Failed requests: 0
Total transferred: 140000 bytes
HTML transferred: 5000 bytes
Requests per second: 46777.06 [#/sec] (mean)
Time per request: 1.069 [ms] (mean)
Time per request: 0.021 [ms] (mean, across all concurrent requests)
Transfer rate: 6395.30 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.2 0 1
Processing: 0 1 0.8 1 7
Waiting: 0 1 0.7 1 7
Total: 0 1 0.8 1 7
Percentage of the requests served within a certain time (ms)
50% 1
66% 1
75% 1
80% 1
90% 2
95% 3
98% 3
99% 3
100% 7 (longest request)
|
@Skyenought Is this line already in your source test? |
@tran-the-lam ok, i will fix them |
i think you can add recover to your code, after you do this you can run service success. I don't know what it's about 😖 |
Recover link not found |
@Skyenought In your test you only request with the same local, you can make it random and send several different requests with several different locals at the same time think you need to copy the value and use a safe map for concurrency problem should be the place already mentioned by me |
@ReneWerner87 I'll try to fix it again. |
Hi, I think I have found the bug and it's placed here. Line 24 in 2bad1b1
When using utils.CopyString on c.Query and c.Get and assigning header and query there to appCfg instead of assigning whole ctx to appCfg I could not face this error again. But I'm new to go and I might be wrong 😅
|
Hi team!
I have an issue. When there are many concurrent requests to our system, fiberi18n throws error like this
My code implemented:
Please help me to solve this problem.
The text was updated successfully, but these errors were encountered: