Skip to content

CURATOR-228 - Modified the background callback to explicitly handle t…#93

Merged
asfgit merged 2 commits into
masterfrom
CURATOR-228
Aug 31, 2015
Merged

CURATOR-228 - Modified the background callback to explicitly handle t…#93
asfgit merged 2 commits into
masterfrom
CURATOR-228

Conversation

@cammckenzie
Copy link
Copy Markdown
Contributor

…he NOAUTH case. This will now log a warning and set a flag indicating that an auth failure has occured.

…he NOAUTH case. This will now log a warning and set a flag indicating that an auth failure has occured.
@madrob
Copy link
Copy Markdown
Contributor

madrob commented Jul 23, 2015

Assuming all the tests pass, +1

@cammckenzie
Copy link
Copy Markdown
Contributor Author

They all pass on my machine, so I guess they're all good.

@Randgalt
Copy link
Copy Markdown
Member

Isn't logging enough? If we're going to have a special method to get auth issues here, we should do it for every recipe which seems like overkill to me. It's really a client error and not a bug in Curator. Logging only seems the correct approach.

@cammckenzie
Copy link
Copy Markdown
Contributor Author

I originally just had logging but then there was no clean way to test it, thus the AtomicBoolean flag. I can make that package protected and @VisibileForTesting if you like.

@Randgalt
Copy link
Copy Markdown
Member

That would be my vote. Otherwise we'd be introducing an API contract that would make its way to the other recipes.

@cammckenzie
Copy link
Copy Markdown
Contributor Author

Done

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to be pedantic. But, isn't this going to be the same issue for InterProcessMutex, etc.? i.e. any ZK recipe that creates nodes - which is a lot of them. I think it's a mistake to have specific handling like this in a single recipe.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly, we probably need to do an audit. I had a look at the InterProcessMutex and I think that it's ok because the node creation happens in the foreground. The PersistentEphemeralNode is problematic because it's all done in the background.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to just log the bad result code. Is there a reason that the check for NOAUTH is needed? Why not just log all non-expected result codes?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should just log an error and stop processing for any code that is not in RetryLoop.shouldRetry()? I was just trying to minimise the impact of the change as it was previously just handling the NodeExists and OK cases and retrying everything else.

@cammckenzie
Copy link
Copy Markdown
Contributor Author

I had a look into implementing a Watch in the case where we get a NOAUTH error when trying to create the ephemeral node. The plan was that when the parent node ACL was modified that the watch would fire and we would retry. Unfortunately it seems that ACL changes in ZK don't fire Watches (I wasn't aware of this), so there doesn't seem to be a way to reliably know when the ACL changes without doing some sort of polling which is pretty ugly.

@asfgit asfgit merged commit cff86ea into master Aug 31, 2015
@hubot hubot deleted the CURATOR-228 branch April 28, 2017 16:43
@asfgit asfgit restored the CURATOR-228 branch April 28, 2017 17:12
@tisonkun tisonkun deleted the CURATOR-228 branch March 13, 2023 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants