joseluisll opened a new pull request, #9020:
URL: https://github.com/apache/hadoop/pull/9020

   `TestZKDelegationTokenSecretManager#testNodesLoadedAfterRestart` 
(hadoop-common) fails intermittently: it races the ZK delegation-token 
background threads around the ZooKeeper restart. Three defects combine:
   
   1. After the restart the test read the new manager's memory immediately; the 
restarted manager loads tokens from ZK asynchronously, so the read could return 
null and the `assertNotNull("good dt should be in memory!")` could fail.
   2. The good token was never renewed before the old manager was destroyed; 
with `RENEW_INTERVAL=5` while the background `ExpiredTokenRemover` is 
hard-coded to sleep at least 5 seconds per loop, the token could expire during 
the restart window.
   3. The token's disappearance after expiry was polled with 
`GenericTestUtils.waitFor`, but the corresponding appearance check after the 
restart was missing.
   
   Changes:
   
   - renew the good token (`tm.renewToken(token, "good")`) before destroying 
the old manager, so it survives the restart window;
   - wait with `GenericTestUtils.waitFor(100, 5000)` for the restarted manager 
to load the token into memory before asserting;
   - widen `RENEW_INTERVAL` from 5 to 10 seconds (and the matching expiry wait) 
so the token does not expire before the final assertions; test runtime grows by 
~5s, and the final removal poll gets a 10s budget wider than the remover's 5s 
sleep quantum.
   
   Testing: with the patch, `TestZKDelegationTokenSecretManager` passes a 
full-class run on the host: Tests run: 12, Failures: 0, Errors: 0 (including 
`testNodesLoadedAfterRestart`).
   
   The same change previously rode in PR #8838 (YARN-12025) as an unrelated 
commit; it is split out here so that PR stays review-scoped.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to