Azure / azure-functions-core-tools

Command line tools for Azure Functions
MIT License
1.29k stars 429 forks source link

CTRL + C doesn't kill process in macOS properly #619

Open alizahid opened 6 years ago

alizahid commented 6 years ago

CTRL + C in Terminal doesn't kill process properly.

I have to go to Activity Monitor to kill it. Or else it keeps consuming CPU and battery.

Today, I didn't close the tab immediately. And after a minute, I saw this in the Terminal window.

[8/8/18 11:11:30 AM] Stopping Host
[8/8/18 11:11:30 AM] Job host stopped
[8/8/18 11:11:50 AM] Worker encountered an error.
[8/8/18 11:11:50 AM] The operation has timed out.

Unhandled Exception: System.AggregateException: An error occurred while writing to logger(s). (Object reference not set to an instance of an object.) ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.ApplicationInsights.Shared.Extensibility.Implementation.PassThroughProcessor.Process(ITelemetry item)
   at Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.SamplingTelemetryProcessor.Process(ITelemetry item)
   at Microsoft.Azure.WebJobs.Logging.ApplicationInsights.FilteringTelemetryProcessor.Process(ITelemetry item) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Logging.ApplicationInsights\FilteringTelemetryProcessor.cs:line 27
   at Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryProcessor.Process(ITelemetry telemetry)
   at Microsoft.ApplicationInsights.TelemetryClient.Track(ITelemetry telemetry)
   at Microsoft.Azure.WebJobs.Logging.ApplicationInsights.ApplicationInsightsLogger.LogTrace(LogLevel logLevel, IEnumerable`1 values, String formattedMessage) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Logging.ApplicationInsights\ApplicationInsightsLogger.cs:line 200
   at Microsoft.Azure.WebJobs.Logging.ApplicationInsights.ApplicationInsightsLogger.LogException(LogLevel logLevel, IEnumerable`1 values, Exception exception, String formattedMessage) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Logging.ApplicationInsights\ApplicationInsightsLogger.cs:line 183
   at Microsoft.Azure.WebJobs.Logging.ApplicationInsights.ApplicationInsightsLogger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func`3 formatter) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Logging.ApplicationInsights\ApplicationInsightsLogger.cs:line 99
   at Microsoft.Extensions.Logging.Logger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func`3 formatter)
   --- End of inner exception stack trace ---
   at Microsoft.Extensions.Logging.Logger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func`3 formatter)
   at Microsoft.Extensions.Logging.LoggerExtensions.Log(ILogger logger, LogLevel logLevel, EventId eventId, Exception exception, String message, Object[] args)
   at Microsoft.Extensions.Logging.LoggerExtensions.LogError(ILogger logger, Exception exception, String message, Object[] args)
   at Microsoft.Azure.WebJobs.Script.Rpc.LanguageWorkerChannel.HandleWorkerError(Exception exc) in C:\azure-webjobs-sdk-script\src\WebJobs.Script\Rpc\LanguageWorkerChannel.cs:line 327
   at System.Reactive.AnonymousSafeObserver`1.OnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.Take`1._.OnError(Exception error)
   at System.Reactive.Sink`1._.OnError(Exception error)
   at System.Reactive.Linq.ObservableImpl.Throw`1._.Invoke()
   at System.Reactive.Concurrency.Scheduler.Invoke(IScheduler scheduler, Action action)
   at System.Reactive.Producer`1.Run(IScheduler _, State x)
   at System.Reactive.Concurrency.ScheduledItem`2.InvokeCore()
   at System.Reactive.Concurrency.CurrentThreadScheduler.Trampoline.Run(SchedulerQueue`1 queue)
   at System.Reactive.Concurrency.CurrentThreadScheduler.Schedule[TState](TState state, TimeSpan dueTime, Func`3 action)
   at System.Reactive.Concurrency.LocalScheduler.Schedule[TState](TState state, Func`3 action)
   at System.Reactive.Producer`1.SubscribeRaw(IObserver`1 observer, Boolean enableSafeguard)
   at System.Reactive.Linq.ObservableImpl.Timeout`1.TimeR.Timeout(IScheduler _, UInt64 myid)
   at System.Reactive.Concurrency.DefaultScheduler.<>c__DisplayClass6_0`1.<Schedule>b__0(Object _)
   at System.Reactive.Concurrency.ConcurrencyAbstractionLayerImpl.Timer.Tick(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.TimerQueueTimer.CallCallback()
   at System.Threading.TimerQueueTimer.Fire()
   at System.Threading.TimerQueue.FireNextTimers()
/bin/sh: line 1: 18995 Abort trap: 6           func start

I'm using 2.0.1-beta.34 on macOS High Sierra 10.13.6.

@paulbatum I mentioned this in a call, if you recall.

ahmedelnably commented 4 years ago

Closing this as stale, please open a new issue if this is still persistent with the new version of the core tools