mirror of
https://github.com/apache/nifi.git
synced 2025-02-16 15:06:00 +00:00
NIFI-259: Distinguish between unable to communicate with ZK and 'bad version' when performing 'replace' method of ZooKeeperStateProvider
Signed-off-by: Aldrin Piri <aldrin@apache.org>
This commit is contained in:
parent
a931e72787
commit
35d2b921ea
@ -439,10 +439,18 @@ public class ZooKeeperStateProvider extends AbstractStateProvider {
|
||||
setState(newValue, (int) oldValue.getVersion(), componentId);
|
||||
return true;
|
||||
} catch (final IOException ioe) {
|
||||
final Throwable cause = ioe.getCause();
|
||||
if (cause != null && cause instanceof KeeperException) {
|
||||
final KeeperException ke = (KeeperException) cause;
|
||||
if (Code.BADVERSION == ke.code()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
throw ioe;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void clear(final String componentId) throws IOException {
|
||||
|
Loading…
x
Reference in New Issue
Block a user