Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NCBC-1337: When a timeout occurs Muxio returns Success with no body
Motivation ---------- If a connection is terminated by the server, any in-flight operations must be canceled and the response should show that they failed. Modifications ------------- - Make AsyncState take an exception when Cancel or Complete is called - If the server fails to respond within the configured timeout, return a OperationTimeout. - If a operation is canceled, return an OperationAbandonedException for each operation. - Add OperationAbandonedException for canceled operations Results ------- If a server connection times out, any in-flight operation will be canceled and an OperationAbandonedException will returned along with a status of ClientFailure. Change-Id: I02af9d0134ac0b0c40a3c0aaf88278ddc8099dc3 Reviewed-on: http://review.couchbase.org/74124 Tested-by: Jeffry Morris <jeffrymorris@gmail.com> Reviewed-by: Mike Goldsmith <goldsmith.mike@gmail.com>
- Loading branch information
1 parent
6242a3a
commit ad23a3f
Showing
9 changed files
with
124 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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,65 @@ | ||
using System; | ||
using Couchbase.Configuration.Client; | ||
using Couchbase.Utils; | ||
|
||
namespace Couchbase.IO | ||
{ | ||
/// <summary> | ||
/// Thrown if an operation does not complete before the <see cref="PoolConfiguration.SendTimeout"/> is exceeded. | ||
/// </summary> | ||
/// <seealso cref="System.TimeoutException" /> | ||
public sealed class SendTimeoutExpiredException : TimeoutException | ||
{ | ||
private string _stackTrace; | ||
|
||
public SendTimeoutExpiredException() | ||
: this(ExceptionUtil.GetMessage(ExceptionUtil.OperationTimeout)) | ||
{ | ||
} | ||
|
||
public SendTimeoutExpiredException(string message) | ||
: base(message) | ||
{ | ||
_stackTrace = Environment.StackTrace; | ||
Source = CurrentAssembly.Current.GetName().Name; | ||
} | ||
|
||
public SendTimeoutExpiredException(string message, Exception innerException) | ||
: base(message, innerException) | ||
{ | ||
_stackTrace = Environment.StackTrace; | ||
Source = CurrentAssembly.Current.GetName().Name; | ||
} | ||
|
||
/// <summary> | ||
/// Gets a string representation of the immediate frames on the call stack. | ||
/// </summary> | ||
public override string StackTrace | ||
{ | ||
get { return _stackTrace; } | ||
} | ||
} | ||
} | ||
|
||
#region [ License information ] | ||
|
||
/* ************************************************************ | ||
* | ||
* @author Couchbase <info@couchbase.com> | ||
* @copyright 2015 Couchbase, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* ************************************************************/ | ||
|
||
#endregion |
This file contains 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 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