ZanderXu opened a new pull request, #6844: URL: https://github.com/apache/hadoop/pull/6844
Both `RouterAdminServer#enterSafeMode()` and `RouterSafemodeService#periodicInvoke()#leave` can change the router state at the same time. Safe-mode change logic should be condensed into one method. And some races may happen in the current implementation, such as: 1. `RouterAdminServer#enterSafeMode()` set router stat to `RouterServiceState.SAFEMODE` 2. `RouterSafemodeService#periodicInvoke()#leave` got true when checking `safeMode && !isSafeModeSetManually` 3. `RouterAdminServer#enterSafeMode()` set `safeMode` and `isSafeModeSetManually` to `true` 4. `RouterAdminServer#enterSafeMode()` get `true` when checking safe-mode 5. `RouterSafemodeService#periodicInvoke()#leave` call `leave()` to leave safe-mode. This RBF is not in safe-mode and `safeMode` is `false`, but `isSafeModeSetManually` is `true`. -- 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]
