Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8434317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:37:25+00:00 2026-06-10T06:37:25+00:00

I am trying to rasterise a map using wkhtmltoimage. I am spinning up a

  • 0

I am trying to rasterise a map using wkhtmltoimage. I am spinning up a new process and passing it the command line arguments that are necessary to get the image that I want.

I’m currently suffering from a very long pause when the process is started. I’ve enabled showing the window to see if there is any dialog related activity that requires user input but there is none. The process sits at 0% CPU for 2 – 3 minutes. Executing the same command on the command like takes a few seconds.

using (Process p = new Process())
{
    ProcessStartInfo info = new ProcessStartInfo(wkhtmlPath, dimensions + EscapeArgument(location) + " -");
    info.UseShellExecute = false;
    info.RedirectStandardOutput = true;
    p.StartInfo = info;
    p.Start();

    byte[] buffer = new byte[32768];
    int read = 0;

    while ((read = p.StandardOutput.BaseStream.Read(buffer, 0, buffer.Length)) > 0)
    {

        //... write bytes to the an ouput buffer
    }

}

It’s taking in the order of minutes to complete. This works fine when it doesn’t point at one of my controllers using the same session. When it uses the same session, the print controller waits for a response from wkhtmltoimage, which is waiting for the print controller to release the lock so it can get the page. Some timeout must be breaking this deadlock. Can I safely release the session lock somehow?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T06:37:26+00:00Added an answer on June 10, 2026 at 6:37 am

    Controller actions are synchronised on the user session by default in MVC3. Re-issuing a request with the same session token causes a deadlock. The re-issued requests waits for the request from which it was issued to give up the lock on the session. I solved this by not using a session at all for the entry point, but it’s probably not the best solution.

    Without further investigation, the best solution is to start thinking about asynchronous controllers. Many controller actions I have written are called asynchronously via ajax. This session locking behaviour shows that the controller is synchronising the requests, which is hardly ideal in cases where there session is not even used.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to create an SSIS package to process a Datacube. Using SMS 2008, I've
Trying to make this jQuery filter that uses .find case-insensitive. For example, when the
Trying to get a wildcard search to pick up on any text in org_name
trying to get same string on tooltip as is in the Text e.g. Text=<%#
Trying to write a windows speech recognition macro. Written using XML and scripting language
Trying to find some information on this but am unable to get any results
Trying to execute a Powershell cmdlet from a MVC 3 Controller using impersonation but
Trying to understand how EDE works by using it to generate Makefiles for a
Trying to do a simple insert, and this one line is giving me issues.
Trying to build a Metro app using Javascript and having issues with IndexedDb. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.