示例#1
0
 private void RoleEnvironmentStatusCheck(object sender, RoleInstanceStatusCheckEventArgs e)
 {
     if (roleIsBusy)
     {
         e.SetBusy();
     }
 }
示例#2
0
 private void RoleEnvironmentStatusCheck(object sender, RoleInstanceStatusCheckEventArgs e)
 {
     if (this.busy)
     {
         e.SetBusy();
     }
     statusCheckWaitHandle.Set();
 }
示例#3
0
 public void SetBusy(object sender, RoleInstanceStatusCheckEventArgs e)
 {
     // set the instance as busy
     if (Switch)
     {
         e.SetBusy();
     }
 }
 void RoleEnvironment_StatusCheck(object sender, RoleInstanceStatusCheckEventArgs e)
 {
     System.Diagnostics.Trace.WriteLine("StatusCheck called");
     if (this._updater.IsUpdating)
     {
         System.Diagnostics.Trace.WriteLine("Setting Busy state as we are updating");
         e.SetBusy();
     }
 }
        /// <summary>
        /// Handle Azure status check events to set the role as busy if the lock file is missing.
        /// </summary>
        /// <param name="sender">Sender object</param>
        /// <param name="e">Event arguments</param>
        static void Chef_StatusCheck(object sender, RoleInstanceStatusCheckEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(ClientService.statusCheckFilePath) ||
                System.IO.File.Exists(ClientService.statusCheckFilePath))
            {
                return;
            }

            e.SetBusy();
        }
        /// <summary>
        /// Handle Azure status check events to set the role as busy if the lock file is missing.
        /// </summary>
        /// <param name="sender">Sender object</param>
        /// <param name="e">Event arguments</param>
        static void Chef_StatusCheck(object sender, RoleInstanceStatusCheckEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(ClientService.statusCheckFilePath) || 
                System.IO.File.Exists(ClientService.statusCheckFilePath))
            {
                return;
            }

            e.SetBusy();
        }
示例#7
0
        private void RoleEnvironment_StatusCheck(object sender, RoleInstanceStatusCheckEventArgs e)
        {
            // NOTE: Used to signal the Node failed to load Destinations
            // BUG: This fails for all but the first insance when run locally and explodes in the cloud
            //if (File.Exists(FilePath))
            ////if (_blockBlob.Exists())
            //{
            //    Trace.WriteLine(string.Format("[{0}] RoleEnvironment_StatusCheck SetBusy", DateTime.Now));

            //    e.SetBusy();
            //}
        }
示例#8
0
        /// <summary>
        /// Roles the environment status check.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="RoleInstanceStatusCheckEventArgs"/> instance containing the event data.</param>
        private void RoleEnvironmentStatusCheck(object sender, RoleInstanceStatusCheckEventArgs e)
        {
            try
            {
                if (this.busy)
                {
                    Debug.WriteLine("WorkerRole Is Busy");
                    //e.SetBusy();
                }

                //TODO: Add code to decide what to do for a busy worker role
            }
            catch (Exception)
            {
            }
        }
示例#9
0
        void RoleEnvironment_StatusCheck(object sender, RoleInstanceStatusCheckEventArgs e)
        {
            if (AzureLeaderElectionProvider.AmITheLeader)
            {
                return;
            }
            bool isBusy = false;

            foreach (var tenants in TenantStatuses)
            {
                isBusy = isBusy || GetTenantStatus(tenants.Key) != TenantStatus.Started;
            }
            if (isBusy)
            {
                e.SetBusy();
            }
        }
        /// <summary>
        /// Occurs at a regular interval to indicate the status of a role instance.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">Represents the arguments for the StatusCheck event, which occurs at a regular interval to indicate the status of a role instance.</param>
        private static void RoleEnvironment_StatusCheck(object sender, RoleInstanceStatusCheckEventArgs e)
        {
            try
            {
                // TraceIn
                TraceEventSource.Log.TraceIn();

                // Write Role Instance Status
                TraceEventSource.Log.TraceInfo(string.Format(RoleInstanceStatusFormat,
                                                             RoleEnvironment.CurrentRoleInstance.Role.Name,
                                                             RoleEnvironment.CurrentRoleInstance.Id,
                                                             e.Status));
            }
            catch (Exception ex)
            {
                // Trace Exception
                TraceEventSource.Log.TraceError(ex.Message, ex.InnerException?.Message ?? string.Empty);
            }
            finally
            {
                // TraceOut
                TraceEventSource.Log.TraceOut();
            }
        }
 private static void RoleEnvironmentStatusCheck(object sender, RoleInstanceStatusCheckEventArgs e)
 {
     RoleInstanceStatus status = e.Status;
     // Uncomment next line to take instance out of the load balancer rotation.
     //e.SetBusy();
 }
示例#12
0
文件: WebRole.cs 项目: akoltz/ggcbnet
 void RoleEnvironment_StatusCheck(object sender, RoleInstanceStatusCheckEventArgs e)
 {
     if (!isReady)
     {
         e.SetBusy();
     }
 }
示例#13
0
 private void RoleEnvironmentStatusCheck(object sender, RoleInstanceStatusCheckEventArgs e)
 {
     if (roleIsBusy)
         e.SetBusy();
 }
示例#14
0
 static void RoleEnvironmentStatusCheck(object sender, RoleInstanceStatusCheckEventArgs e)
 {
     Trace.WriteLine(e.Status);
 }
示例#15
0
 static void RoleEnvironmentStatusCheck(object sender, RoleInstanceStatusCheckEventArgs e)
 {
     Trace.WriteLine(e.Status);
 }
示例#16
0
 /// <summary>
 /// STATUS CHECK : Control the avaibility of this instance for the WindowsAzure load balancer
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void RoleEnvironment_StatusCheck(object sender, RoleInstanceStatusCheckEventArgs e)
 {
     if (this.busy)
     {
         e.SetBusy();
         Trace.TraceWarning("StatusCheck - The status of the role instance has been set to busy - Instance is unsubscribed from the Azure load balancer");
     }
 }