title: Azure webjob - QueueTrigger stops triggering
body: <p>I am running an azure webjobs SDK console application (continuous) with the recommended setup:</p>
  
  <pre><code>public static void ProcessQueueMessage([QueueTrigger("logqueue")] string logMessage, TextWriter logger)
  </code></pre>
  
  <p>The azure queue I am running against has ~6000 messages in it and I am running the web-job locally, as a console application. </p>
  
  <p>The problem I'm having is that the processing randomly stops after processing between zero and ~30 messages.  The console stays open, but no more console messages are displayed.</p>
  
  <p>For example, it might just process 2 messages:</p>
  
  <pre><code>Executing: 'Functions.ProcessQueueMessage' - Reason: 'New queue message detected on 'QueueName'.'
  Executed: 'Functions.ProcessQueueMessage' (Succeeded)
  Executing: 'Functions.ProcessQueueMessage' - Reason: 'New queue message detected on 'QueueName'.'
  Executed: 'Functions.ProcessQueueMessage' (Succeeded)
  </code></pre>
  
  <p>And then, nothing.  There doesn't seem to be anything wrong with my internet connection and I can't trace the issues down to any particular messages.</p>
  
  <p>Has anyone else had issues with this SDK?  </p>
  
  <p><strong>Update:</strong></p>
  
  <p>I made sure that I was using the right versions of all of the dependencies by removing the nuget packages and then re-running install-package Microsoft.Axure.Webjobs.  I am now using webjobs version 1.1.0 which has pulled in version 4.3 of azure storage.</p>
  
  <p>As recommended by Matthew, I have pulled down the source code for azure webjobs to determine where the process is freezing up.  Once the freez-up occurs, I pause execution and checked the running threads for what I believe is the culprit within <code>Microsoft.Azure.WebJobs.Host.CompositeTraceWriter</code></p>
  
  <pre><code>    protected virtual void InvokeTextWriter(TraceEvent traceEvent)
      {
          if (_innerTextWriter != null)
          {
              string message = traceEvent.Message;
              if (!string.IsNullOrEmpty(message) &amp;&amp;
                   message.EndsWith("\r\n", StringComparison.OrdinalIgnoreCase))
              {
                  // remove any terminating return+line feed, since we're
                  // calling WriteLine below
                  message = message.Substring(0, message.Length - 2);
              }
  
              _innerTextWriter.WriteLine(message);
              if (traceEvent.Exception != null)
              {
                  _innerTextWriter.WriteLine(traceEvent.Exception.ToDetails());
              }
          }
      }
  </code></pre>
  
  <p>The line it freezes on is line 66 : <code>_innerTextWriter.WriteLine(message);</code></p>
  
  <p><code>_innerTextWriter</code> is an instance of <code>System.IO.TextWriter.SyncTextWriter</code></p>
  
  <p>Is it possible there is some deadlock issue with this class or the way it is being used? </p>
  
  <p>Some notes:</p>
  
  <ul>
  <li>I am running in the debugger, so in this case I believe the textwriter is forwarding to the console internally</li>
  <li>I have my batchsize set to 1 via <code>config.Queues.BatchSize = 1;</code>, not sure if that could matter</li>
  </ul>
  
  <p>I'm currently working on setting up an environment on another computer so that I can see if it is reproducible somewhere other than this machine (surface book).</p>
  
  <p><strong>Update</strong></p>
  
  <p>The issue was me not understanding how the new windows 10 command prompt works.  Any time you click on the command window, it goes into "select" mode which <em>completely pauses execution of the process.</em></p>
  
  <p>Basically: <a href="https://superuser.com/questions/419717/windows-command-prompt-freezing-randomly?newreg=ece53f5584254346be68f85d1fd2f18d">https://superuser.com/questions/419717/windows-command-prompt-freezing-randomly?newreg=ece53f5584254346be68f85d1fd2f18d</a></p>
  
  <p>You can tell it is in this state because it will prefix the window title with the word "Select":</p>
  
  <p><a href="https://i.stack.imgur.com/dwimT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dwimT.png" alt="frozen command window"></a></p>
  
  <p>You have to press enter or click again to get it going once again.</p>
  
  <p>So, two final comments:</p>
  
  <p>1) What an incredibly confusing and un-intuitive behavior for a command window!</p>
  
  <p>2) I hope some admin will come take pity on the shame I have brought upon myself and my family by deleting this question.</p>
  
  <p>To get rid of this strange behavior, you can disable QuickEdit mode:</p>
  
  <p><a href="https://i.stack.imgur.com/Qd7XZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Qd7XZ.png" alt="disable QuickEdit Mode"></a></p>