question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Recycling application pool invalidates all Signal Url

See original GitHub issue

Hi, I am using Elsa 1.5.4.1816 which seems to be the latest to date and I seem to have very fundamental issue. I have .Net standard 5.0 project which runs Elsa flows.

I am using blocking activity as singlaed and generating my signal using the following:

private async Task<string> GetSignalUrl(WorkflowExecutionContext context, string signalName)
       {
           try
           {
               WorkflowExpression<string> urlExpression =
                   new JavaScriptExpression<string>("`${signalUrl('" + signalName + "')}`");
               string signalUrl = await context.EvaluateAsync(urlExpression, CancellationToken.None);
               return signalUrl;
           }
           catch (Exception e)
           {
               _logger.LogError(e.ToString());
               throw;
           }
       }

I am then dispatching email and display it on UI for the next activity to signal. Everything is working fine and our complex flow finishes fine as long as we don’t recycle application pool OR restart the website.

Since these are long running flows, it is almost with certainty that we have to deploy a code with bug fixes and/or new features and at that time we will have to stop and start the application pool.

Once application pool recycles, all the urls generated using the above code is not valid anymore and I get 404 for all the workflows.

I don’t know whether it is a bug or if I am doing something which is not correct.

I will appreciate if someone can promptly respond with their experience and/or solution. We are already in UA and ready to go live next week and I discovered this huge issue.

Thanks.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
andy-22commented, May 5, 2021

As mentioned by @sfmskywalker we have take care of this from startup itself… For people like me looking for a solution, here is what I did:

services.AddDataProtection() .PersistKeysToFileSystem(new DirectoryInfo(Configuration.GetSection(“DataProtectionConfiguration:DataProtectionKeyPath”).Value.ToString())) .ProtectKeysWithCertificate(new X509Certificate2(Configuration.GetSection(“DataProtectionConfiguration:SigningCertificatePfxFilePath”).Value.ToString(), Configuration.GetSection(“DataProtectionConfiguration:SigningCertificatePfxFilePassword”).Value.ToString())) .SetDefaultKeyLifetime(TimeSpan.FromDays(Convert.ToInt32(Configuration.GetSection(“DataProtectionConfiguration:DataProtectionKeyExpiry”).Value))) .SetApplicationName(“APPLICATION_NAME”)

I can confirm that, after this changes, it survives my app pool restarts, new deployment, etc. Flow still can continue just fine.

This issue Now can be closed.

0reactions
craigfowlercommented, May 5, 2021

I don’t think there’s anything in Elsa that needs to be configured. Configuring data protection can be done from your Startup class.

Does that mean “not a bug, and not currently earmarked for doing any code change in Elsa 2.0” ? I’m not suggesting immediately closing this, since it doesn’t seem like we are all 100% certain about the root cause, but it seems we think it’s a deployment/environment-specific config that needs making and not part of Elsa.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error occurred in deployment step 'Recycle IIS Application ...
Error occurred in deployment step 'Recycle IIS Application Pool': Cannot connect to the SharePoint site: Make sure that this is a valid URL...
Read more >
c# - Restarting (Recycling) an Application Pool
Here is a simple solution if you just want to recycle all the app pools on the current machine. I had to "run...
Read more >
iis 7 - IIS7 APP pool recycling: what is the valid format for a ...
I'm trying to specify an app pool recycling schedule to more than one specific time, but I'm receiving an error invalid schedule string...
Read more >
Recycling Settings for an Application Pool <recycling>
The <recycling> element contains configuration settings that control the conditions that trigger IIS 7 to restart an application pool.
Read more >
Advanced configuration of the ASP.NET Core Module and IIS
IIS Application Initialization is an IIS feature that sends an HTTP request to the app when the app pool starts or is recycled....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found