Skip to content
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

minor cleanup of (unused / rarely used) classes #992

Merged
merged 1 commit into from
Dec 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
// Copyright (c) 2007-2020 VMware, Inc. All rights reserved.
//---------------------------------------------------------------------------

using RabbitMQ.Client.Framing;

namespace RabbitMQ.Client.Exceptions
{
///<summary>Thrown when frame parsing code detects an error in the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
// Copyright (c) 2007-2020 VMware, Inc. All rights reserved.
//---------------------------------------------------------------------------

using RabbitMQ.Client.Framing;

namespace RabbitMQ.Client.Exceptions
{
/// <summary> Thrown when our peer sends a frame that contains
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
// Copyright (c) 2007-2020 VMware, Inc. All rights reserved.
//---------------------------------------------------------------------------

using RabbitMQ.Client.Framing;
using RabbitMQ.Client.Impl;

namespace RabbitMQ.Client.Exceptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
// Copyright (c) 2007-2020 VMware, Inc. All rights reserved.
//---------------------------------------------------------------------------

using RabbitMQ.Client.Framing;

namespace RabbitMQ.Client.Exceptions
{
/// <summary>
Expand Down

This file was deleted.

This file was deleted.

40 changes: 13 additions & 27 deletions projects/RabbitMQ.Client/client/impl/Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
//---------------------------------------------------------------------------

using System;
using System.Buffers;
using System.Collections.Generic;
using System.IO;
using System.Net;
Expand Down Expand Up @@ -246,7 +245,8 @@ public TimeSpan Heartbeat

public IDictionary<string, object> ServerProperties { get; set; }

public IList<ShutdownReportEntry> ShutdownReport { get; } = new SynchronizedList<ShutdownReportEntry>(new List<ShutdownReportEntry>());
public IList<ShutdownReportEntry> ShutdownReport => _shutdownReport;
private ShutdownReportEntry[] _shutdownReport = Array.Empty<ShutdownReportEntry>();

///<summary>Explicit implementation of IConnection.Protocol.</summary>
IProtocol IConnection.Protocol => Endpoint.Protocol;
Expand Down Expand Up @@ -490,7 +490,14 @@ public void InternalClose(ShutdownEventArgs reason)
public void LogCloseError(string error, Exception ex)
{
ESLog.Error(error, ex);
ShutdownReport.Add(new ShutdownReportEntry(error, ex));

lock (_shutdownReport)
{
var replacement = new ShutdownReportEntry[_shutdownReport.Length + 1];
replacement[replacement.Length - 1] = new ShutdownReportEntry(error, ex);
_shutdownReport.CopyTo(replacement.AsSpan());
_shutdownReport = replacement;
}
}

public void MainLoop()
Expand Down Expand Up @@ -662,24 +669,6 @@ public void Open(bool insist)
_model0.ConnectionOpen(_factory.VirtualHost, string.Empty, false);
}

public void PrettyPrintShutdownReport()
{
if (ShutdownReport.Count == 0)
{
Console.Error.WriteLine(
"No errors reported when closing connection {0}", this);
}
else
{
Console.Error.WriteLine(
"Log of errors while closing connection {0}:", this);
for (int index = 0; index < ShutdownReport.Count; index++)
{
Console.Error.WriteLine(ShutdownReport[index].ToString());
}
}
}

///<summary>
/// Sets the channel named in the SoftProtocolException into
/// "quiescing mode", where we issue a channel.close and
Expand Down Expand Up @@ -806,12 +795,9 @@ public void HeartbeatReadTimerCallback(object state)
// of the heartbeat setting in setHeartbeat above.
if (_missedHeartbeats > 2 * 4)
{
string description = string.Format("Heartbeat missing with heartbeat == {0} seconds", _heartbeat);
var eose = new EndOfStreamException(description);
ESLog.Error(description, eose);
ShutdownReport.Add(new ShutdownReportEntry(description, eose));
HandleMainLoopException(
new ShutdownEventArgs(ShutdownInitiator.Library, 0, "End of stream", eose));
var eose = new EndOfStreamException($"Heartbeat missing with heartbeat == {_heartbeat} seconds");
LogCloseError(eose.Message, eose);
HandleMainLoopException(new ShutdownEventArgs(ShutdownInitiator.Library, 0, "End of stream", eose));
shouldTerminate = true;
}
}
Expand Down
86 changes: 0 additions & 86 deletions projects/RabbitMQ.Client/util/SetQueue.cs

This file was deleted.

Loading