private void Run()

in AdlsDotNetSDK/AclTools/AclProcessor.cs [422:483]


        private void Run()
        {
            try
            {
                while (true)
                {
                    if (_cancelToken.IsCancellationRequested)
                    {
                        return;
                    }

                    var job = Queue.Poll();
                    if (GetException() != null || job == null || job is PoisonJob)//Exception or Poision block (all threads are waiting)
                    {
                        Queue.Add(new PoisonJob());
                        return;
                    }

                    try
                    {
                        job.DoRun(AclJobLog);
                    }
                    catch (AdlsException ex)
                    {
                        if (ex.HttpStatus != HttpStatusCode.NotFound)//Do not stop acl processor if the file/directory is deleted
                        {
                            if (_ignoreVerifyTimeErrors)
                            {
                                DumpIgnoredVerificationError(job);
                            }
                            else
                            {
                                SetException(ex);//Sets the global exception to signal other threads to close
                                Queue.Add(new PoisonJob());//Handle corner cases like when exception is raised other threads can be in wait state
                                return;
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        if (_ignoreVerifyTimeErrors)
                        {
                            DumpIgnoredVerificationError(job);
                        }
                        else
                        {
                            SetException(ex);
                            Queue.Add(new PoisonJob());//Handle corner cases like when exception is raised other threads can be in wait state
                            return;
                        }
                    }
                }
            }
            catch (Exception e)
            {
                // This should never come here, but just in case of SynchronizationLockException at least thread will exit dutifully
                if (AclLog.IsDebugEnabled)
                {
                    AclLog.Debug("Unexpected error: " + e.Message);
                }
            }
        }