HangfireIO / HangfireIO/Hangfire

Server stopping and starting again

Open
#1,237 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
10.1k
Forks
1.8k
Avg merge
1h 19m
Merged PRs (30d)
1

Description

Hi,
I have been using Hangfire 1.3.4 in production for a while, and wanted to do an upgrade to the latest version 1.6.19 (upgraded to 1.6.20 also). Everything seems to work fine, all jobs run, hangfire starts smoothly and everything seemed to be OK.

The only issue is when i run a specific method that calls PhantomJS, this call serveral urls running the script with NReco.PhantomJS library.
- When i call this method from a Controller, the hangfire Stop method is called, and the current server stops creating a new one in a couple of seconds.
- When its run from a recurring job, i got "The job was aborted SERVER is not in the active server list", creating a new server and running again the job, that hasnt finished, and keep doing this killing the server memory.

Did anyone run into the same issue? How could it be resolved?

```

using (var driver = new PhantomJS())
{
driver.OutputReceived += (sender, e) => {
if (String.IsNullOrEmpty(e.Data)) return;
if (e.Data.Contains("ReturnResponse="))
{
response = e.Data.Replace("ReturnResponse=", "");
}
};
StreamReader streamReader = new StreamReader(pathToScript);
string script = streamReader.ReadToEnd();
streamReader.Close();
await Task.Run(() => driver.RunScriptAsync(script, args));
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.