Uh oh!
There was an error while loading. Please reload this page.
test: add uv threadpool congestion regression test - #23099
Conversation
Trott
commented
Sep 26, 2018
This test fails without an internet connection so it probably needs to go in Here's what I get if I disconnect from the network: $ tools/test.py test/sequential/test-uv-threadpool-schedule.js === release test-uv-threadpool-schedule === Path: sequential/test-uv-threadpool-scheduleassert.js:349 throw err; ^AssertionError [ERR_ASSERTION]: fast I/O took longer to complete, actual: 10, expected: 0.57 at GetAddrInfoReqWrap.dns.lookup.common.mustCall (/Users/trott/io.js/test/sequential/test-uv-threadpool-schedule.js:45:14) at GetAddrInfoReqWrap.callback (/Users/trott/io.js/test/common/index.js:349:15) at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:58:17)Command: out/Release/node /Users/trott/io.js/test/sequential/test-uv-threadpool-schedule.js[00:00|% 100|+ 0|- 1]: Done
$ |
cjihrig
commented
Sep 26, 2018
This also seems like it will have the potential to be flakey when run on the CI. |
There was a problem hiding this comment.
Throw in an assert.ifError maybe?
There was a problem hiding this comment.
sorry, didn't follow you - can you please elaborate? all these lookups are destined to fail, we are latching on the time they take for un-optimized full blown lookups (so as to maximize the threadpool worker thread's engagement)
There was a problem hiding this comment.
In that case, using a base string and then keep incrementing an offset would guarantee that there will be no repetition in the domain names used, right? Because, the random numbers might repeat (even though odds of that happening is less)
There was a problem hiding this comment.
thanks for the suggestion, followed your suggestion.
There was a problem hiding this comment.
@thefourtheye - I just spotted a drawback of doing this: if you run the test back-to-back, it fails the second time onwards - for obvious reasons (the domain strings being static, they get resolved faster). I don't know if it affects our CI tests though.
There was a problem hiding this comment.
Did you mean to use 97 ('a') instead of 92 ('\')?
There was a problem hiding this comment.
removed the method altogether. (yes, I meant a , don't know how I kept it at 92. ;) )
95fdbbe to
cfb651eComparegireeshpunathil
commented
Sep 27, 2018
@Trott - moved this to @cjihrig - I acknowledge that the test is sensitive to response times. For that matter I took these precautions:
If you think any specific construct / logic is prone to flake, please let me know, I am happy to improve on it. |
b114e0a to
e2541eeCompareThere was a problem hiding this comment.
Does the test still work if we use one of the reserved TLDs (e.g. .test)? https://tools.ietf.org/html/rfc2606
There was a problem hiding this comment.
- dns.lookup(`${randomDomain}${i}.com`, {}, common.mustCall(() => {+ dns.lookup(`${randomDomain}${i}.test`, {}, common.mustCall(() => {@richardlau - I tested with this change (if that is what you meant) and it still works. But what would be an advantage of it?
There was a problem hiding this comment.
The reserved TLDs are specifically reserved to avoid conflicts with actual registered domain names, e.g. nonexistent0.com might exist in the future.
They can also avoid unnecessary load on the DNS servers, see https://tools.ietf.org/html/rfc6761 section 6.
There was a problem hiding this comment.
@richardlau : ok - let me clarify: the purpose of the test is to engage (half of) the libuv threadpool workers as long as possible while making sure at least one thread is free and available to serve the file I/Os. So in that context, what we want is a list of domain names that are unique, and were unresolved earlier (resolved names are cached so retrieved faster than we wanted them to), existent or non-existent is not a consideration for the test. If the name is confusing, I can change it to unique0.com etc.
Am I missing anything?
There was a problem hiding this comment.
If caching is an issue, we might need to generate domain names that are unique per-test-run, e.g. based on Date.now() or Math.random()?
There was a problem hiding this comment.
yes (my first commit 1d0fcefec8a42b71166e572de14b308e1dc97e58) had it based on Math.random(). I guess I will re-instate that, thanks.
gireeshpunathil
commented
Sep 28, 2018
Trott
commented
Sep 30, 2018
I suppose pinging @nodejs/libuv to review may be appropriate here. |
gireeshpunathil
commented
Sep 30, 2018
thanks @Trott . Also cc @nodejs/testing ? |
gireeshpunathil
commented
Oct 4, 2018
re-instated the random domain function, else the test runs the risk of looking up previously resolved domain names and messing up with the time calculation. new CI: https://ci.nodejs.org/job/node-test-pull-request/17620/ |
gireeshpunathil
commented
Oct 4, 2018
|
There was a problem hiding this comment.
Nit: The callback function can be moved out and used with common.mustCall(..., slowIOmax).
There was a problem hiding this comment.
I moved the callback body out of the loop. However, issue with attaching expected call count to the common.mustCall is: the loop executes 100 times, and each time when we invoke common.mustCall with slowIOmax, the total expectation becomes 10K. So I left it as is (default:1). Hope this is fine with you?
There was a problem hiding this comment.
I was thinking about something like
constonResolve=common.mustCall(...,slowIOmax);
...
dns.lookup(...,onResolve);But your current change is intuitive. Let's go with that.
Trott
commented
Oct 4, 2018
Trott
commented
Oct 4, 2018
Full CI re-run post-fixup: https://ci.nodejs.org/job/node-test-pull-request/17627/ |
addaleax
left a comment
There was a problem hiding this comment.
LGTM, but we might need to be careful about landing this because the libuv patch may be at fault for a regression in our tests, see nodejs/reliability#18 (comment)
gireeshpunathil
commented
Oct 5, 2018
thanks @addaleax for the info. sure, let me hold this until the |
gireeshpunathil
commented
Oct 5, 2018
@addaleax - also if you can describe a higher level statement on the flakes that the current |
addaleax
commented
Oct 5, 2018
@gireeshpunathil So … as far as I can tell, the issue was that I think any test that would perform a lot of fast DNS requests (e.g. for |
Trott
commented
Nov 21, 2018
@addaleax@gireeshpunathil Can this move forward? Or is it blocked on libuv for now? Or something else? |
gireeshpunathil
commented
Nov 21, 2018
I believe the test makes meaningful assertions only in the presence of libuv/libuv@daf04e8 , that is slated to land in node through libuv v1.24.x |
gireeshpunathil
commented
Dec 6, 2018
Resume Build CI: https://ci.nodejs.org/job/node-test-commit/24015/ |
gireeshpunathil
commented
Dec 7, 2018
not sure what to make out of the CI result. the graphical view says something failed, but going into the link I can't see any? |
gireeshpunathil
commented
Dec 8, 2018
to be sure, re-run CI: https://ci.nodejs.org/job/node-test-commit/24081/ |
gireeshpunathil
commented
Dec 9, 2018
Failures in both Linux and AIX are the same, Fresh CI: https://ci.nodejs.org/job/node-test-pull-request/19350/ |
gireeshpunathil
commented
Dec 10, 2018
after many runs of CI in expectation of a green sign giving up for now!
I will attempt to debug that first to see what is happening. |
gireeshpunathil
commented
Dec 28, 2018
all the known failures are either marked as flaky or resolved; so another round of CI - looks like I can't resume from the old build, it is expired: |
04786b3 to
05c3ae9Comparegireeshpunathil
commented
Dec 28, 2018
a test is timing out in |
gireeshpunathil
commented
Dec 29, 2018
with 2 separate runs on arm and windows https://ci.nodejs.org/job/node-test-commit-arm-fanned/5471/ now the CI gets a full green. |
Validate that massive dns lookups do not block filesytem I/O (or any fast I/O for that matter). Prior to libuv/libuv#1845 few back-to-back dns lookup were sufficient to engage libuv threadpool workers in a blocking manner, throttling other work items that need the pool. this test acts as a regression test for the same. Start slow and fast I/Os together, and make sure fast I/O can complete in at least in 1/100th of time for slow I/O. Refs: libuv/libuv#1845 Refs: nodejs#8436 PR-URL: nodejs#23099 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
05c3ae9 to
54fa59cCompareValidate that massive dns lookups do not block filesytem I/O (or any fast I/O for that matter). Prior to libuv/libuv#1845 few back-to-back dns lookup were sufficient to engage libuv threadpool workers in a blocking manner, throttling other work items that need the pool. this test acts as a regression test for the same. Start slow and fast I/Os together, and make sure fast I/O can complete in at least in 1/100th of time for slow I/O. Refs: libuv/libuv#1845 Refs: #8436 PR-URL: #23099 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Trott
commented
Jan 1, 2019
I'll open a separate issue, but this test failed on node-daily-master (the only place where internet tests are run) last night. Considering it was only added two days, that's probably cause for concern? https://ci.nodejs.org/job/node-test-commit-custom-suites/810/default/console test-rackspace-ubuntu1604-x64-1 00:02:11 not ok 25 internet/test-uv-threadpool-schedule00:02:11 ---00:02:11 duration_ms: 0.61300:02:11 severity: fail00:02:11 exitcode: 100:02:11 stack: |-00:02:11 assert.js:35100:02:11 throw err;00:02:11 ^00:02:11 00:02:11 AssertionError [ERR_ASSERTION]: fast I/O took longer to complete, actual: 17, expected: 3.6300:02:11 at GetAddrInfoReqWrap.onResolve (/home/iojs/build/workspace/node-test-commit-custom-suites/default/test/internet/test-uv-threadpool-schedule.js:41:12)00:02:11 at GetAddrInfoReqWrap.callback (/home/iojs/build/workspace/node-test-commit-custom-suites/default/test/common/index.js:376:15)00:02:11 at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:57:17)00:02:11 ... |
thefourtheye
commented
Jan 7, 2019
Interesting. Looks like fast IO is really not 100 times faster than slow IO in our infra. @gireeshpunathil Would it be okay to change the test to ensure that the fast IO takes lesser time (not 1/100th but simply |
gireeshpunathil
commented
Jan 7, 2019
@thefourtheye - yes, and that is @Trott's #25358 |
Validate that massive dns lookups do not block filesytem I/O (or any fast I/O for that matter). Prior to libuv/libuv#1845 few back-to-back dns lookup were sufficient to engage libuv threadpool workers in a blocking manner, throttling other work items that need the pool. this test acts as a regression test for the same. Start slow and fast I/Os together, and make sure fast I/O can complete in at least in 1/100th of time for slow I/O. Refs: libuv/libuv#1845 Refs: nodejs#8436 PR-URL: nodejs#23099 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Validate that massive dns lookups do not block filesytem I/O (or any fast I/O for that matter). Prior to libuv/libuv#1845 few back-to-back dns lookup were sufficient to engage libuv threadpool workers in a blocking manner, throttling other work items that need the pool. this test acts as a regression test for the same. Start slow and fast I/Os together, and make sure fast I/O can complete in at least in 1/100th of time for slow I/O. Refs: libuv/libuv#1845 Refs: #8436 PR-URL: #23099 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Validate that massive dns lookups do not block filesytem I/O (or any fast I/O for that matter). Prior to libuv/libuv#1845 few back-to-back dns lookup were sufficient to engage libuv threadpool workers in a blocking manner, throttling other work items that need the pool. this test acts as a regression test for the same. Start slow and fast I/Os together, and make sure fast I/O can complete in at least in 1/100th of time for slow I/O. Refs: libuv/libuv#1845 Refs: #8436 PR-URL: #23099 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Validate that massive dns lookups do not block filesytem I/O (or any fast I/O for that matter). Prior to libuv/libuv#1845 few back-to-back dns lookup were sufficient to engage libuv threadpool workers in a blocking manner, throttling other work items that need the pool. this test acts as a regression test for the same. Start slow and fast I/Os together, and make sure fast I/O can complete in at least in 1/100th of time for slow I/O. Refs: libuv/libuv#1845 Refs: #8436 PR-URL: #23099 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Validate that massive dns lookups do not block filesytem I/O (or any fast I/O for that matter). Prior to libuv/libuv#1845 few back-to-back dns lookup were sufficient to engage libuv threadpool workers in a blocking manner, throttling other work items that need the pool. this test acts as a regression test for the same. Start slow and fast I/Os together, and make sure fast I/O can complete in at least in 1/100th of time for slow I/O. Refs: libuv/libuv#1845 Refs: #8436 PR-URL: #23099 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Validate that massive dns lookups do not block filesytem I/O (or any fast I/O for that matter).
Prior to libuv/libuv#1845 few back-to-back dns lookup were sufficient to engage libuv threadpool workers in a blocking manner, throttling other work items that need the pool. this test acts as a regression test for the same.
Start slow and fast I/Os together, and make sure fast I/O can complete in at least in 1/100th of time for slow I/O.
Refs: libuv/libuv#1845
Refs: #8436
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes