Don't run code in the TIMEOUT event (check that we don't do that) #14

Closed
opened 2021-11-20 11:15:25 +00:00 by ungleich-gitea · 12 comments

I think the following logic is fundamentally broken:

        for request_event in request_iterator:
            request_entry = RequestEntry(request_event)
            # Never Run time critical mechanism inside timeout
            # mechanism because timeout mechanism only comes
            # when no other event is happening. It means under
            # heavy load there would not be a timeout event.
            if request_entry.type == "TIMEOUT":

                # Detect hosts that are dead and set their status
                # to "DEAD", and their VMs' status to "KILLED"
                dead_hosts = dead_host_detection()
                if dead_hosts:
                    logger.debug("Dead hosts: %s", dead_hosts)
                    dead_host_mitigation(dead_hosts)

Just run the code that should ALWAYS be executed prior to the if statement.

I think the following logic is fundamentally broken: ``` for request_event in request_iterator: request_entry = RequestEntry(request_event) # Never Run time critical mechanism inside timeout # mechanism because timeout mechanism only comes # when no other event is happening. It means under # heavy load there would not be a timeout event. if request_entry.type == "TIMEOUT": # Detect hosts that are dead and set their status # to "DEAD", and their VMs' status to "KILLED" dead_hosts = dead_host_detection() if dead_hosts: logger.debug("Dead hosts: %s", dead_hosts) dead_host_mitigation(dead_hosts) ``` Just run the code that should ALWAYS be executed prior to the if statement.
ahmedbilal was assigned by ungleich-gitea 2021-11-20 11:15:25 +00:00
Author

Removed, although still have some concerns. See the above comment.

Removed, although still have some concerns. See the above comment.
Author

@nico I am not sure yet about removing the timeout mechanism and moving the maintenance code inside i.e handling of user's request, because it is entirely possible that user's don't make any request for a long time which also means that we won't execute the maintenance code that is responsible for updating the status/hostname of VMs.

@nico I am not sure yet about removing the timeout mechanism and moving the maintenance code inside i.e handling of user's request, because it is entirely possible that user's don't make any request for a long time which also means that we won't execute the maintenance code that is responsible for updating the status/hostname of VMs.
Author

Thanks. Yes, it doesn't make sense in scheduler.

Thanks. Yes, it doesn't make sense in scheduler.
Author

Removed, although still have some concerns. See the above comment.

Removed, although still have some concerns. See the above comment.
Author

@nico I am not sure yet about removing the timeout mechanism and moving the maintenance code inside i.e handling of user's request, because it is entirely possible that user's don't make any request for a long time which also means that we won't execute the maintenance code that is responsible for updating the status/hostname of VMs.

@nico I am not sure yet about removing the timeout mechanism and moving the maintenance code inside i.e handling of user's request, because it is entirely possible that user's don't make any request for a long time which also means that we won't execute the maintenance code that is responsible for updating the status/hostname of VMs.
Author

Thanks. Yes, it doesn't make sense in scheduler.

Thanks. Yes, it doesn't make sense in scheduler.
Author

Removed, although still have some concerns. See the above comment.

Removed, although still have some concerns. See the above comment.
Author

@nico I am not sure yet about removing the timeout mechanism and moving the maintenance code inside i.e handling of user's request, because it is entirely possible that user's don't make any request for a long time which also means that we won't execute the maintenance code that is responsible for updating the status/hostname of VMs.

@nico I am not sure yet about removing the timeout mechanism and moving the maintenance code inside i.e handling of user's request, because it is entirely possible that user's don't make any request for a long time which also means that we won't execute the maintenance code that is responsible for updating the status/hostname of VMs.
Author

Thanks. Yes, it doesn't make sense in scheduler.

Thanks. Yes, it doesn't make sense in scheduler.
Author

Removed, although still have some concerns. See the above comment.

Removed, although still have some concerns. See the above comment.
Author

@nico I am not sure yet about removing the timeout mechanism and moving the maintenance code inside i.e handling of user's request, because it is entirely possible that user's don't make any request for a long time which also means that we won't execute the maintenance code that is responsible for updating the status/hostname of VMs.

@nico I am not sure yet about removing the timeout mechanism and moving the maintenance code inside i.e handling of user's request, because it is entirely possible that user's don't make any request for a long time which also means that we won't execute the maintenance code that is responsible for updating the status/hostname of VMs.
Author

Thanks. Yes, it doesn't make sense in scheduler.

Thanks. Yes, it doesn't make sense in scheduler.
nico closed this issue 2022-02-15 08:47:23 +00:00
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: uncloud/uncloud#14
No description provided.