Commit d9d78f8b authored by Marc Gravell's avatar Marc Gravell

dispose pipe with physical connection; update lib; use dedicated db for FlushFetchRandomKey()

parent 6c7e575b
...@@ -29,11 +29,11 @@ public void TestScan() ...@@ -29,11 +29,11 @@ public void TestScan()
} }
[Fact] [Fact]
public void RandomKey() public void FlushFetchRandomKey()
{ {
using (var conn = Create(allowAdmin: true)) using (var conn = Create(allowAdmin: true))
{ {
var db = conn.GetDatabase(); var db = conn.GetDatabase(7);
conn.GetServer(TestConfig.Current.MasterServerAndPort).FlushDatabase(); conn.GetServer(TestConfig.Current.MasterServerAndPort).FlushDatabase();
string anyKey = db.KeyRandom(); string anyKey = db.KeyRandom();
......
...@@ -24,6 +24,6 @@ ...@@ -24,6 +24,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Pipelines.Sockets.Unofficial" Version="0.2.1-alpha.51" /> <PackageReference Include="Pipelines.Sockets.Unofficial" Version="0.2.1-alpha.52" />
</ItemGroup> </ItemGroup>
</Project> </Project>
\ No newline at end of file
...@@ -1564,6 +1564,7 @@ private async Task<ServerEndPoint> NominatePreferredMaster(TextWriter log, Serve ...@@ -1564,6 +1564,7 @@ private async Task<ServerEndPoint> NominatePreferredMaster(TextWriter log, Serve
if (useTieBreakers) if (useTieBreakers)
{ // count the votes { // count the votes
uniques = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase); uniques = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);
LogLocked(log, "Waiting for tiebreakers...");
await WaitAllIgnoreErrorsAsync(tieBreakers, 50, log).ForAwait(); await WaitAllIgnoreErrorsAsync(tieBreakers, 50, log).ForAwait();
for (int i = 0; i < tieBreakers.Length; i++) for (int i = 0; i < tieBreakers.Length; i++)
{ {
......
...@@ -127,6 +127,7 @@ public void Dispose() ...@@ -127,6 +127,7 @@ public void Dispose()
try { ioPipe.Output?.Complete(); } catch { } try { ioPipe.Output?.Complete(); } catch { }
ioPipe.Output?.Complete(); ioPipe.Output?.Complete();
} }
try { using (ioPipe as IDisposable) { } } catch { }
if (socketToken.HasValue) if (socketToken.HasValue)
{ {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<ProjectReference Include="..\StackExchange.Redis\StackExchange.Redis.csproj" /> <ProjectReference Include="..\StackExchange.Redis\StackExchange.Redis.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Pipelines.Sockets.Unofficial" Version="0.2.1-alpha.51" /> <PackageReference Include="Pipelines.Sockets.Unofficial" Version="0.2.1-alpha.52" />
</ItemGroup> </ItemGroup>
</Project> </Project>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment