Skip to content

JAVA-1212: Don't retry non-idempotent statements by default.#696

Merged
olim7t merged 2 commits into
3.0from
java1212
Jul 18, 2016
Merged

JAVA-1212: Don't retry non-idempotent statements by default.#696
olim7t merged 2 commits into
3.0from
java1212

Conversation

@olim7t
Copy link
Copy Markdown
Contributor

@olim7t olim7t commented Jun 21, 2016

No description provided.

@olim7t olim7t added this to the 3.1.0 milestone Jun 21, 2016
}

private void logIdempotenceWarning() {
if (WARNED_IDEMPOTENT.compareAndSet(false, true))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What do you think about establishing a common logger implementation for messages like this? This way users can easily suppress warnings like this globally for all changes. Some users pay very close attention to warnings and try their best to suppress all the ones that doesn't affect their application health.

@tolbertam
Copy link
Copy Markdown
Contributor

tolbertam commented Jun 30, 2016

A bunch of tests look to have been broken with this, but I think it should be pretty easy to fix. Tests need to either be updated to mark certain statements as idempotent, or update their expected exceptions to account for the fact that they won't be retried, i'll take care of that. EDIT: Fixed

/**
* Base class for retry policy integration tests.
* <p/>
* <p>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ack, my bad, my environment is targeting JDK 8 which uses <p> instead of <p/> will fix.

olim7t added 2 commits July 18, 2016 13:29
This was opt-in behavior in 3.0.0, make it the default because it's the
right thing to do. The counterpart is that the isIdempotent flag needs
to be positioned properly on statements, the doc has been updated in
that regard.

This was made as an "internal" change (as opposed to a retry policy
implementation), so that it would work with any retry policy. Therefore
`IdempotenceAwareRetryPolicy` becomes redundant and was deprecated.
These methods always return the same result. Extract constants to avoid
building a new object each time (even though the JVM probably optimized
it eventually).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants