コード例 #1
0
 // Token: 0x06000271 RID: 625 RVA: 0x0000DC20 File Offset: 0x0000BE20
 protected override void OnTransientFailure(InterestingEvent interestingEvent, AIException exception)
 {
     if (exception is TransientMailboxException)
     {
         ExTraceGlobals.EventDispatcherTracer.TraceError <EventDispatcherPrivate, long, AIException>((long)this.GetHashCode(), "{0}: retryable mailbox exception, mapiEvent {1}: {2}", this, interestingEvent.MapiEvent.EventCounter, exception);
         lock (base.Locker)
         {
             this.ClearPendingQueue();
             if (!this.IsInRetry)
             {
                 if (this.IsMailboxDead && ExTraceGlobals.EventDispatcherTracer.IsTraceEnabled(TraceType.DebugTrace))
                 {
                     ExTraceGlobals.EventDispatcherTracer.TraceDebug <EventDispatcherPrivate>((long)this.GetHashCode(), "{0}: Mailbox had been on TransientFailure, but was found dead", this);
                 }
                 this.isInRetry = true;
                 base.Controller.DecrementEventQueueCount();
                 base.Assistant.PerformanceCounters.FailedDispatchers.Increment();
                 if (EventDispatcherPrivate.syncWithTestCodeAfterEventQueueCountDecrementedForRetry != null)
                 {
                     EventDispatcherPrivate.syncWithTestCodeAfterEventQueueCountDecrementedForRetry();
                 }
             }
         }
     }
 }
コード例 #2
0
        private Watermark[] BuildWatermarkArray(Guid assistantId)
        {
            ExTraceGlobals.EventControllerTracer.TraceDebug <EventControllerPrivate, Guid, int>((long)this.GetHashCode(), "{0}: Building Watermark Array for {1}. Dispatcher count: {2}", this, assistantId, this.dispatchers.Count);
            List <Watermark> list = new List <Watermark>(this.dispatchers.Count + 1);
            long             highestEventPolled = base.HighestEventPolled;

            ExTraceGlobals.EventControllerTracer.TraceDebug <EventControllerPrivate, long>((long)this.GetHashCode(), "{0}: HighestWatermarkPolled: {1}", this, highestEventPolled);
            foreach (MailboxDispatcher mailboxDispatcher in this.MailboxDispatchers)
            {
                EventDispatcherPrivate assistantDispatcher = mailboxDispatcher.GetAssistantDispatcher(assistantId);
                Watermark currentWatermark = assistantDispatcher.GetCurrentWatermark(ref highestEventPolled);
                if (currentWatermark != null)
                {
                    ExTraceGlobals.EventControllerTracer.TraceDebug <EventControllerPrivate, Guid, long>((long)this.GetHashCode(), "{0}: Saving watermark: mailbox: {1}, counter: {2}", this, currentWatermark.MailboxGuid, currentWatermark.EventCounter);
                    list.Add(currentWatermark);
                }
                else
                {
                    ExTraceGlobals.EventControllerTracer.TraceDebug <EventControllerPrivate, Guid>((long)this.GetHashCode(), "{0}: Not updating watermark for mailbox: {1}", this, assistantDispatcher.MailboxGuid);
                }
            }
            ExTraceGlobals.EventControllerTracer.TraceDebug <EventControllerPrivate, long>((long)this.GetHashCode(), "{0}: DatabaseWatermark is {1}", this, highestEventPolled);
            if (highestEventPolled != base.DatabaseBookmark[assistantId])
            {
                ExTraceGlobals.EventControllerTracer.TraceDebug <EventControllerPrivate, long>((long)this.GetHashCode(), "{0}: Saving DatabaseWatermark: {1}", this, highestEventPolled);
                list.Add(Watermark.GetDatabaseWatermark(highestEventPolled));
            }
            else
            {
                ExTraceGlobals.EventControllerTracer.TraceDebug <EventControllerPrivate>((long)this.GetHashCode(), "{0}: DatabaseWatermark has not changed -- not saving", this);
            }
            return(list.ToArray());
        }
コード例 #3
0
 public void RequestRecovery(EventDispatcherPrivate dispatcher)
 {
     ExTraceGlobals.EventControllerTracer.TraceDebug <EventControllerPrivate, EventDispatcherPrivate>((long)this.GetHashCode(), "{0}: Adding dispatcher to recovery queue: {1}", this, dispatcher);
     lock (this.recoveryQueue)
     {
         this.recoveryQueue.Enqueue(dispatcher);
     }
 }
コード例 #4
0
        private long RecoverDispatchers()
        {
            long num = long.MaxValue;

            lock (this.recoveryQueue)
            {
                while (this.recoveryQueue.Count > 0)
                {
                    EventDispatcherPrivate eventDispatcherPrivate = this.recoveryQueue.Dequeue();
                    num = Math.Min(num, eventDispatcherPrivate.RecoveryEventCounter);
                    ExTraceGlobals.EventControllerTracer.TraceDebug <EventControllerPrivate, EventDispatcherPrivate, long>((long)this.GetHashCode(), "{0}: Recovering dispatcher {1} with recovery counter {2}", this, eventDispatcherPrivate, eventDispatcherPrivate.RecoveryEventCounter);
                    eventDispatcherPrivate.Recover();
                }
            }
            return(num);
        }
コード例 #5
0
        public static MailboxDispatcher CreateFromBookmark(EventControllerPrivate controller, EventAccess eventAccess, MapiEvent[] eventTable, Bookmark mailboxBookmark, Bookmark databaseBookmark)
        {
            MailboxDispatcher mailboxDispatcher = new MailboxDispatcher(mailboxBookmark.Identity, controller, controller.Assistants.Count);

            foreach (AssistantCollectionEntry assistantCollectionEntry in controller.Assistants)
            {
                EventDispatcherPrivate value = new EventDispatcherPrivate(mailboxDispatcher, assistantCollectionEntry, controller, mailboxBookmark[assistantCollectionEntry.Identity]);
                mailboxDispatcher.assistantDispatchers.Add(assistantCollectionEntry.Identity, value);
                assistantCollectionEntry.PerformanceCounters.EventDispatchers.Increment();
            }
            foreach (EventDispatcherPrivate eventDispatcherPrivate in mailboxDispatcher.assistantDispatchers.Values)
            {
                eventDispatcherPrivate.Initialize(eventAccess, eventTable, databaseBookmark[eventDispatcherPrivate.AssistantIdentity]);
            }
            return(mailboxDispatcher);
        }