-
Notifications
You must be signed in to change notification settings - Fork 357
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
BlobTrigger poison queue fix (#804) #956
Conversation
_sharedWatcher.Notify(_poisonQueue.Name); | ||
// TODO: this is assuming that the poison queue is in the same | ||
// storage account | ||
_sharedWatcher.Notify(e.PoisonQueue.Name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to create a bug for this. Not an real issue, but something we should look to improve. This shared watcher notify stuff is just a way to wake up a sleeping queue listener faster when something is written to it on the same instance, so we don't have to wait for the exponential backoff interval.
/// The poison message | ||
/// </summary> | ||
public CloudQueueMessage Message { get; private set; } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this mean in the Blob case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing. Remember that blob trigger works by enqueuing messages, which we set up an internal "shared listener" on. It's a message that contains a payload that points to the triggering blob, etc.
@@ -211,13 +213,9 @@ public QueueProcessor(QueueProcessorFactoryContext context) | |||
/// Called to raise the MessageAddedToPoisonQueue event | |||
/// </summary> | |||
/// <param name="e">The event arguments</param> | |||
protected internal virtual void OnMessageAddedToPoisonQueue(EventArgs e) | |||
protected internal virtual void OnMessageAddedToPoisonQueue(PoisonMessageEventArgs e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OnMessageAddedToPoisonQueue [](start = 40, length = 27)
Why is this exposed?
If somebody wants to react to the poison message, can they just use a [QueueTrigger] on the poison queue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, customers set up queue trigger functions to process the poison queue. QueueProcessor is a lower level advanced thing, and if you see how it is used, you'll see that other aspects of our infra need to know when a poison message is added.
// by default this should target the same storage account | ||
// as the blob container we're monitoring | ||
var poisonQueueClient = userQueueClient; | ||
if (_dataAccount.Type == StorageAccountType.BlobOnly) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this to _dataAccount.Type != StorageAccountType.GeneralPurpose
, Premium storage would trip here as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch - changed
01419ae
to
2dbd92b
Compare
// as the blob container we're monitoring | ||
var poisonQueueClient = targetQueueClient; | ||
if (_dataAccount.Type != StorageAccountType.GeneralPurpose || | ||
_blobsConfiguration.CentralizePoisonQueue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is where we use the new flag to force the poison queue to be in the primary account.
/// <summary> | ||
/// Represents configuration for <see cref="BlobTriggerAttribute"/>. | ||
/// </summary> | ||
public class JobHostBlobsConfiguration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likely there will be additional blob scan knobs we want to expose in the future as well. I do remember this coming up before but we didn't have a way previously.
@@ -51,31 +49,6 @@ public static void Run([BlobTrigger(BlobPath)] ICloudBlob blob) | |||
} | |||
} | |||
|
|||
[Fact] | |||
public void BlobTrigger_IfBindingAlwaysFails_MovesToPoisonQueue() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing this test because we already have test coverage for poison scenarios, and the test no longer runs because it relies on mocking of the internal QueueProcessor which isn't possible anymore because I now have a new SharedBlobQueueProcessor in place. I fiddled too long with getting the test to keep running, and it isn't worth it because we have coverage already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Merged in 56b5302 |
Fix for #804