async http handler crashes occasionally on iis7

Discussion in 'ASP .Net' started by Mark Weaver, Feb 7, 2010.

  1. Mark Weaver

    Mark Weaver Guest

    I have an asynchronous http handler that crashes on iis7 (on w2k8 x64
    or w7 x64) -- I didn't see this behaviour on iis6 (w2k3 x86) where it
    was running for around 2 years. It's reasonably reproducible under
    load.

    Basically the handler is just calling BeginRead() on a file, then
    BeginWrite() on HttpResponse.OutputStream, then when finished it calls
    the callback passed to BeginProcessRequest. On the odd occasion this
    callback throws a NullReferenceException, with the backtrace listed
    below. I've logged everything it does to a StringBuilder to check
    what it's doing, but I don't see anything other than read/write/finish
    -- which is the same as the case where it doesn't crash. google
    doesn't show much up for the backtrace.

    I assume I'm doing something wrong that trips up iis7, but I can't see
    it, any hints? (I have checked that the handler is not completing
    synchronously -- the IAsyncResult objects from the BeginRead callback
    on the file and the BeginWrite callbacks on the OutputStream all
    say .CompletedSynchronously=false).

    Thanks,

    Mark

    backtrace:
    System.Web.dll!System.Web.HttpApplication.CurrentModuleContainer.get()
    Line 552 + 0x19 bytes C#
    System.Web.dll!
    System.Web.HttpApplication.PipelineStepManager.ResumeSteps(System.Exception
    error) Line 3755 + 0xc bytes C#
    System.Web.dll!
    System.Web.HttpApplication.ResumeStepsFromThreadPoolThread(System.Exception
    error) Line 2270 + 0xd bytes C#
    System.Web.dll!
    System.Web.HttpApplication.CallHandlerExecutionStep.ResumeStepsWithAssert(System.Exception
    error) Line 3302 + 0xf bytes C#
    System.Web.dll!
    System.Web.HttpApplication.CallHandlerExecutionStep.OnAsyncHandlerCompletion(System.IAsyncResult
    ar) Line 3298 C#
    NPSL.FsCache.dll!
    NPSL.FsCache.AsyncResultNoResult.Complete(System.Exception exception =
    null, bool completedSynchronously = false) Line 65 + 0x2a bytes C#
    NPSL.FilePak.dll!NPSL.FilePak.FilePakHandler.WriteCompleted(object
    extraData = {NPSL.FsCache.AsyncResultNoResult}, System.Exception e =
    null) Line 80 + 0x1a bytes C#
    NPSL.FsCache.dll!
    NPSL.FsCache.CachedFile.WriteAsyncInfo.Finish(System.Exception e =
    null, string reason = "BeginRead completed: ok") Line 145 + 0x27
    bytes C#
    NPSL.FsCache.dll!NPSL.FsCache.CachedFile.WriteAsyncInfo.BeginRead()
    Line 246 + 0x1c bytes C#
    NPSL.FsCache.dll!
    NPSL.FsCache.CachedFile.WriteAsyncInfo_OutputWriteCompleted(System.IAsyncResult
    ar = {System.Runtime.Remoting.Messaging.AsyncResult}) Line 160 + 0x9
    bytes C#
    mscorlib.dll!
    System.Runtime.Remoting.Messaging.AsyncResult.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage
    msg) + 0x168 bytes
    mscorlib.dll!
    System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage
    msg, System.Runtime.Remoting.Messaging.IMessageSink replySink) + 0x33e
    bytes
    mscorlib.dll!
    System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.ThreadPoolCallBack(object
    o) + 0x58 bytes
    mscorlib.dll!System.Threading.ExecutionContext.runTryCode(object
    userData) + 0x178 bytes
    [Native to Managed Transition]
    [Managed to Native Transition]
    mscorlib.dll!
    System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext
    executionContext, System.Threading.ContextCallback callback, object
    state) + 0x62 bytes
    mscorlib.dll!
    System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(System.Threading._ThreadPoolWaitCallback
    tpWaitCallBack) + 0x61 bytes
    mscorlib.dll!
    System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(object
    state) + 0x4f bytes
    [Appdomain Transition]
    Mark Weaver, Feb 7, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. S. Justin Gengo
    Replies:
    0
    Views:
    703
    S. Justin Gengo
    Aug 5, 2003
  2. =?Utf-8?B?ZGF2ZQ==?=

    iis7 / Vista http handler permission issue? help please

    =?Utf-8?B?ZGF2ZQ==?=, Jun 23, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    494
    =?Utf-8?B?ZGF2ZQ==?=
    Jun 23, 2007
  3. Juan Marcial
    Replies:
    5
    Views:
    2,206
    Juan T. Llibre
    Dec 13, 2008
  4. Steven
    Replies:
    0
    Views:
    346
    Steven
    Nov 30, 2005
  5. Anthony Hunt

    Web service Async call doesn't work on Win 2008/IIS7 Ideas?

    Anthony Hunt, Mar 20, 2009, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    884
    Anthony Hunt
    Mar 20, 2009
Loading...

Share This Page