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
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ internal static async Task<string> GetParentInstanceIdDirectlyFromTable(IDurable
{
// Trying history table instead (new format)
// Need to narrow the scan operation by timestamp (because history tables grow large)
// Also need to put it under a feature switch, as it still might be a performance issue

string featureFlags = Environment.GetEnvironmentVariable(EnvVariableNames.AzureWebJobsFeatureFlags);
bool isDisabled = featureFlags.Contains(Globals.DfMonDisableNewParentIdResolutionAlgorithm);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry @scale-tone, just noticed that featureFlags should be null when env variable is missing. It should be checked

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're totally right, @RemyBoyer , thanks! Pushed a fix as a separate PR.

if (isDisabled)
{
return null;
}

var instanceEntity = (await tableClient.ExecuteAsync($"{durableClient.TaskHubName}Instances", TableOperation.Retrieve(instanceId, string.Empty)))
.Result as DynamicTableEntity;
Expand Down
4 changes: 4 additions & 0 deletions durablefunctionsmonitor.dotnetbackend/Common/Globals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace DurableFunctionsMonitor.DotNetBackend
static class EnvVariableNames
{
public const string AzureWebJobsStorage = "AzureWebJobsStorage";
public const string AzureWebJobsFeatureFlags = "AzureWebJobsFeatureFlags";
public const string WEBSITE_SITE_NAME = "WEBSITE_SITE_NAME";
public const string WEBSITE_AUTH_V2_CONFIG_JSON = "WEBSITE_AUTH_V2_CONFIG_JSON";
public const string WEBSITE_AUTH_CLIENT_ID = "WEBSITE_AUTH_CLIENT_ID";
Expand Down Expand Up @@ -67,6 +68,9 @@ static class Globals
public const string IdentityBasedConnectionSettingClientIdSuffix = "__clientId";
public const string IdentityBasedConnectionSettingCredentialValue = "managedidentity";

public const string DfMonDisableNewParentIdResolutionAlgorithm = "DfMonDisableNewParentIdResolutionAlgorithm";


public static void SplitConnNameAndHubName(string connAndHubName, out string connName, out string hubName)
{
int pos = connAndHubName.LastIndexOf("-");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ internal static async Task<string> GetParentInstanceIdDirectlyFromTable(DurableT
{
// Trying history table instead (new format)
// Need to narrow the scan operation by timestamp (because history tables grow large)
// Also need to put it under a feature switch, as it still might be a performance issue

string featureFlags = Environment.GetEnvironmentVariable(EnvVariableNames.AzureWebJobsFeatureFlags);
bool isDisabled = featureFlags.Contains(Globals.DfMonDisableNewParentIdResolutionAlgorithm);
if (isDisabled)
{
return null;
}

var instanceEntity = (await tableClient.ExecuteAsync($"{durableClient.Name}Instances", TableOperation.Retrieve(instanceId, string.Empty)))
.Result as DynamicTableEntity;
Expand Down
3 changes: 3 additions & 0 deletions durablefunctionsmonitor.dotnetisolated.core/Common/Globals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace DurableFunctionsMonitor.DotNetIsolated
static class EnvVariableNames
{
public const string AzureWebJobsStorage = "AzureWebJobsStorage";
public const string AzureWebJobsFeatureFlags = "AzureWebJobsFeatureFlags";
public const string WEBSITE_SITE_NAME = "WEBSITE_SITE_NAME";
public const string WEBSITE_AUTH_V2_CONFIG_JSON = "WEBSITE_AUTH_V2_CONFIG_JSON";
public const string WEBSITE_AUTH_CLIENT_ID = "WEBSITE_AUTH_CLIENT_ID";
Expand Down Expand Up @@ -66,6 +67,8 @@ static class Globals

public const string DfmModeContextValue = "DfmModeContextValue";

public const string DfMonDisableNewParentIdResolutionAlgorithm = "DfMonDisableNewParentIdResolutionAlgorithm";

/// <summary>
/// Provides support for dedicated Storage accounts (different from AzureWebJobsStorage)
/// </summary>
Expand Down
Loading