Skip to content
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
4 changes: 2 additions & 2 deletions sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/EventProcessorClient.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ private async Task RunAsync(CancellationToken cancellationToken)
}
catch (EventHubsException ex)
{
var errorEventArgs = new ProcessErrorEventArgs(null, ex.Message, ex, cancellationToken);
var errorEventArgs = new ProcessErrorEventArgs(null, ex.Message, ex.InnerException ?? ex, cancellationToken);
Comment thread
jsquire marked this conversation as resolved.
_ = OnProcessErrorAsync(errorEventArgs);
}
catch (Exception ex)
Expand Down Expand Up @@ -1040,7 +1040,7 @@ private async Task StartPartitionProcessingAsync(string partitionId,
// partition.

Logger.StartPartitionProcessingError(partitionId, ex.Message);
var errorEventArgs = new ProcessErrorEventArgs(null, Resources.OperationListCheckpoints, ex, cancellationToken);
var errorEventArgs = new ProcessErrorEventArgs(partitionId, Resources.OperationListCheckpoints, ex, cancellationToken);
_ = OnProcessErrorAsync(errorEventArgs);

return;
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Runtime.CompilerServices;
using NUnit.Framework;

[assembly: Parallelizable(ParallelScope.All)]

[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")]
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,11 @@ public virtual async ValueTask<PartitionOwnership> RunLoadBalancingAsync(string[
cancellationToken.ThrowIfCancellationRequested<TaskCanceledException>();

// If ownership list retrieval fails, give up on the current cycle. There's nothing more we can do
// without an updated ownership list.
// without an updated ownership list. Set the EventHubName to null so it doesn't modify the exception
// message. This exception message is used so the processor can retrieve the raw Operation string, and
// adding the EventHubName would append unwanted info to it.

throw new EventHubsException(true, EventHubName, Resources.OperationListOwnership, ex);
throw new EventHubsException(true, null, Resources.OperationListOwnership, ex);
}

// There's no point in continuing the current cycle if we failed to fetch the completeOwnershipList.
Expand All @@ -192,7 +194,7 @@ public virtual async ValueTask<PartitionOwnership> RunLoadBalancingAsync(string[

foreach (PartitionOwnership ownership in completeOwnershipList)
{
if (utcNow.Subtract(ownership.LastModifiedTime.Value) < OwnershipExpiration && !string.IsNullOrWhiteSpace(ownership.OwnerIdentifier))
if (utcNow.Subtract(ownership.LastModifiedTime.Value) < OwnershipExpiration && !string.IsNullOrEmpty(ownership.OwnerIdentifier))
{
if (ActiveOwnershipWithDistribution.ContainsKey(ownership.OwnerIdentifier))
{
Expand Down Expand Up @@ -416,7 +418,12 @@ private async Task RenewOwnershipAsync(CancellationToken cancellationToken)
// end up losing some of its ownership.

Logger.RenewOwnershipError(OwnerIdentifier, ex.Message);
throw new EventHubsException(true, EventHubName, Resources.OperationRenewOwnership, ex);

// Set the EventHubName to null so it doesn't modify the exception message. This exception message is
// used so the processor can retrieve the raw Operation string, and adding the EventHubName would append
// unwanted info to it.

throw new EventHubsException(true, null, Resources.OperationRenewOwnership, ex);
}
finally
{
Expand Down Expand Up @@ -472,7 +479,11 @@ private async Task<PartitionOwnership> ClaimOwnershipAsync(string partitionId,

Logger.ClaimOwnershipError(partitionId, ex.Message);

throw new EventHubsException(true, EventHubName, Resources.OperationClaimOwnership, ex);
// Set the EventHubName to null so it doesn't modify the exception message. This exception message is
// used so the processor can retrieve the raw Operation string, and adding the EventHubName would append
// unwanted info to it.

throw new EventHubsException(true, null, Resources.OperationClaimOwnership, ex);
}

// We are expecting an enumerable with a single element if the claim attempt succeeds.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using Microsoft.Azure.Management.EventHub.Models;
using Microsoft.Azure.Management.ResourceManager;
using Microsoft.Rest;
using Microsoft.Rest.Azure;

namespace Azure.Messaging.EventHubs.Tests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Azure.Messaging.EventHubs.Tests
/// store the checkpoints and partition ownership to a persistent store instead.
/// </summary>
///
internal sealed class MockCheckPointStorage : StorageManager
internal class MockCheckPointStorage : StorageManager
{
/// <summary>The primitive for synchronizing access during ownership update.</summary>
private readonly object _ownershipLock = new object();
Expand Down
1 change: 0 additions & 1 deletion sdk/eventhub/Azure.Messaging.EventHubs/src/EventData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ public Stream BodyAsStream
/// <param name="eventBody">The raw data to use as the body of the event.</param>
///
public EventData(ReadOnlyMemory<byte> eventBody) : this(eventBody, lastPartitionSequenceNumber: null)

{
}

Expand Down