-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Cosmos CFP: fix for race condition issue #6205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0546cf0
ChangeFeedProcessor; fixes and extra logging related to the creations…
milismsft efa38c8
Port consistency policy bug fix (see https://github.com/Azure/azure-c…
milismsft ddf5652
Update how we log some of the error related cases.
milismsft 00faa5c
Addressing PR feedback.
milismsft e41ae58
Fix condition chek issue.
milismsft f65b378
address PR feedback
milismsft f70b742
ChangeFeedProcessor: fix a race condition issue where the lease has b…
milismsft 9556540
Remove accidental change to logging properties file
milismsft f9afe86
Undo version changes
milismsft 19d39bd
Merge branch 'master' into v3-cfp-hotfix-3.4.0
milismsft ff08350
Address PR feedback
milismsft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
...ain/java/com/azure/data/cosmos/internal/changefeed/exceptions/LeaseConflictException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
| package com.azure.data.cosmos.internal.changefeed.exceptions; | ||
|
|
||
| import com.azure.data.cosmos.internal.changefeed.Lease; | ||
|
|
||
| /** | ||
| * Exception occurred when the lease was updated by a different thread or worker while current thread is trying to update it as well. | ||
| */ | ||
| public class LeaseConflictException extends RuntimeException { | ||
| private static final String DEFAULT_MESSAGE = "The lease was updated by a different worker."; | ||
| private Lease lease; | ||
|
|
||
| /** | ||
| * Initializes a new instance of the @link LeaseConflictException} class. | ||
| */ | ||
| public LeaseConflictException() { | ||
| } | ||
|
|
||
| /** | ||
| * Initializes a new instance of the @link LeaseConflictException} class using the specified lease. | ||
| * | ||
| * @param lease an instance of a lost lease. | ||
| */ | ||
| public LeaseConflictException(Lease lease) { | ||
| super(DEFAULT_MESSAGE); | ||
| this.lease = lease; | ||
| } | ||
|
|
||
| /** | ||
| * Initializes a new instance of the @link LeaseConflictException} class using the specified lease. | ||
| * | ||
| * @param lease an instance of a lost lease. | ||
| * @param message the exception error message. | ||
| */ | ||
| public LeaseConflictException(Lease lease, String message) { | ||
| super(message); | ||
| this.lease = lease; | ||
| } | ||
|
|
||
| /** | ||
| * Initializes a new instance of the @link LeaseConflictException} class using error message. | ||
| * | ||
| * @param message the exception error message. | ||
| */ | ||
| public LeaseConflictException(String message) { | ||
| super(message); | ||
| } | ||
|
|
||
| /** | ||
| * Initializes a new instance of the @link LeaseConflictException} class using error message and inner exception. | ||
| * | ||
| * @param message the exception error message. | ||
| * @param innerException the inner exception. | ||
| * | ||
| */ | ||
| public LeaseConflictException(String message, Exception innerException) { | ||
| super(message, innerException.getCause()); | ||
| } | ||
|
|
||
| /** | ||
| * Gets the lost lease. | ||
| * | ||
| * @return the lost lease. | ||
| */ | ||
| public Lease getLease() { | ||
| return this.lease; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.