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

Fix timeout poller and startup diagnostics bugs #608

Merged
merged 2 commits into from
Sep 5, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ Task WaitIfNeeded(DateTimeOffset nextPoll, CancellationToken cancellationToken)
var waitTime = nextPoll - DateTimeOffset.UtcNow;
if (waitTime > TimeSpan.Zero)
{
if (waitTime > MaxSleepDuration)
{
// Task.Delay() throws for times > int.MaxValue ms, which is ~24.85 days
waitTime = MaxSleepDuration;
}
return Task.Delay(waitTime, cancellationToken);
}

Expand Down
2 changes: 1 addition & 1 deletion src/NServiceBus.Transport.Msmq/MsmqTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public override async Task<TransportInfrastructure> Initialize(HostSettings host
UseDeadLetterQueueForMessagesWithTimeToBeReceived,
TimeToReachQueue = GetFormattedTimeToReachQueue(TimeToReachQueue),
TimeoutQueue = delayedDeliveryMessagePump?.ReceiveAddress,
TimeoutStorageType = DelayedDelivery?.DelayedMessageStore?.GetType(),
TimeoutStorageType = DelayedDelivery?.DelayedMessageStore?.GetType()?.FullName,
});

var infrastructure = new MsmqTransportInfrastructure(messageReceivers, dispatcher, delayedDeliveryPump);
Expand Down