-
Notifications
You must be signed in to change notification settings - Fork 449
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
HostID Collision detection #7682
Conversation
public class HostIdValidator | ||
{ | ||
public const string BlobPathFormat = "ids/usage/{0}"; | ||
private const LogLevel DefaultLevel = LogLevel.Warning; |
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.
When this is merged to the v4 branch, we simply have to update this to default Error level.
c36c339
to
17773ba
Compare
// Schedule the validation to run asynchronously after a delay. This delay ensures | ||
// we're not impacting coldstart, and also gives time for the primary host to be | ||
// identified. | ||
Utility.ExecuteAfterDelay(() => Task.Run(() => ValidateHostIdUsageAsync(hostId)), TimeSpan.FromSeconds(validationDelaySeconds)); |
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.
Is there a reason for the Task.Run
here?
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 need to kick off an asynchronous background task that isn't awaited. I could remove the Task.Run, and add inline #pragmas to ignore the unawaited task warnings, but this seems preferable.
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.
With the language version we're using, we should be able to use a discard, right?
17773ba
to
45d0e5c
Compare
45d0e5c
to
e72dae2
Compare
Adding logic to detect host ID collisions in shared storage accounts. In Functions v3 this will log a warning when detected, and in v4 it will be an error.
Breaking change proposal for v4: Azure/Azure-Functions#2049