Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

Commit

Permalink
When a TimedOutException happens were marking the IsClientHealthy as …
Browse files Browse the repository at this point in the history
…false, should be true as TimedOutException happens

on the timeout of a command, which still means the client is healthy to accept other requests.
  • Loading branch information
eplowe committed Nov 20, 2012
1 parent 85528d9 commit 0a93c33
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion FluentCassandra.sln
Expand Up @@ -20,7 +20,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{1A88B962
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentCassandra.Tests", "test\FluentCassandra.Tests\FluentCassandra.Tests.csproj", "{9DAF7022-5820-4214-B13E-AC0A1B37691F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApplication2", "..\..\dev\BTCassandra.Interop\ConsoleApplication2\ConsoleApplication2.csproj", "{63108852-4D94-4726-8EE3-5DE5D50963E8}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestPoolExhaustion", "..\..\dev\BTCassandra.Interop\ConsoleApplication2\TestPoolExhaustion.csproj", "{63108852-4D94-4726-8EE3-5DE5D50963E8}"
EndProject
Global
GlobalSection(TestCaseManagementSettings) = postSolution
Expand Down
2 changes: 1 addition & 1 deletion src/Operations/CassandraOperationException.cs
Expand Up @@ -21,7 +21,7 @@ public CassandraOperationException(UnavailableException exc)
: base("Cassandra server is unavailable.", exc, false, true) { }

public CassandraOperationException(TimedOutException exc)
: base("Connection to Cassandra has timed out.", exc, false, true) { }
: base("Connection to Cassandra has timed out.", exc, true, true) { }

public CassandraOperationException(IOException exc)
: base(exc.Message, exc, false, true) {}
Expand Down
44 changes: 22 additions & 22 deletions src/Operations/Operation.cs
Expand Up @@ -5,21 +5,21 @@

namespace FluentCassandra.Operations
{
public abstract class Operation<TResult>
{
public Operation()
{
HasError = false;
}
public abstract class Operation<TResult>
{
public Operation()
{
HasError = false;
}

public CassandraContext Context { get; set; }
public CassandraSession Session { get; set; }
public CassandraContext Context { get; set; }
public CassandraSession Session { get; set; }

public bool HasError { get; protected set; }
public CassandraException Error { get; protected set; }
public bool HasError { get; protected set; }
public CassandraException Error { get; protected set; }

public virtual bool TryExecute(out TResult result)
{
public virtual bool TryExecute(out TResult result)
{
try
{
result = Execute();
Expand Down Expand Up @@ -60,17 +60,17 @@ public virtual bool TryExecute(out TResult result)
result = default(TResult);
}

return !HasError;
}
return !HasError;
}

private void ExceptionOccurred(CassandraException exc)
{
Debug.WriteLine(exc);
private void ExceptionOccurred(CassandraException exc)
{
Debug.WriteLine(exc);

HasError = true;
Error = exc;
}
HasError = true;
Error = exc;
}

public abstract TResult Execute();
}
public abstract TResult Execute();
}
}

0 comments on commit 0a93c33

Please sign in to comment.