Google ACE Deploying and Implementing a Cloud Solution Practice Question
A company runs a stateless batch processing application on a managed instance group (MIG) of Compute Engine instances. The application reads tasks from a Cloud Pub/Sub subscription and writes results to Cloud Storage. The operations team wants to ensure that when an instance is terminated during scaling down or maintenance, the application finishes its current task before the instance shuts down. The application currently does not handle SIGTERM. What should the operations team do to meet this requirement with minimal changes?
⚠ Common exam trap
The trap here is assuming that autoscaling or load balancing alone can prevent task interruption, when actually the instance shutdown sequence requires application-level signal handling and a configured graceful shutdown period.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Configure the MIG to use a graceful shutdown period and modify the application to handle the SIGTERM signal to complete in-flight work.
To gracefully finish work during instance termination, the application must handle the SIGTERM signal, and the MIG must allow enough time for that work to complete. Compute Engine provides a configurable shutdown period that extends the default 90-second window. Without SIGTERM handling, the application is killed abruptly; without an extended period, even a well-behaved application may be terminated before finishing. Combining both ensures reliable task completion.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Enable autoscaling based on Pub/Sub queue depth and set the minimum number of instances to the maximum expected workload.
Why it's wrong here
Autoscaling based on Pub/Sub queue depth helps scale the MIG in response to pending messages, but it does not prevent instance termination from interrupting in-flight tasks. Setting a high minimum instance count avoids scale-down but does not protect against maintenance events or manual termination. This does not ensure graceful completion of current tasks and is not a minimal change.
- ✓
Configure the MIG to use a graceful shutdown period and modify the application to handle the SIGTERM signal to complete in-flight work.
Why this is correct
Compute Engine sends a SIGTERM signal before stopping an instance, and the shutdown period can be extended beyond the default 90 seconds by setting a graceful shutdown duration on the instance template or MIG. By handling SIGTERM, the application can finish processing the current Pub/Sub message and acknowledge it, ensuring no task is lost during scale-in or maintenance events. This directly addresses the requirement with minimal architectural change.
- ✗
Use a rolling update strategy with a long health check grace period and rely on the load balancer to drain connections.
Why it's wrong here
A rolling update strategy and health check grace period affect how new instances are brought into service and how traffic is routed, but they do not control the shutdown sequence of an instance being terminated. The load balancer can drain HTTP connections, but the application processes Pub/Sub messages asynchronously and may not have active connections. This does not ensure the current task completes before termination.
- ✗
Create a shutdown script that immediately stops the application and deletes any unacknowledged Pub/Sub messages.
Why it's wrong here
A shutdown script that stops the application and deletes messages would cause data loss because the in-flight task would be abandoned and its message removed. The requirement is to finish the current task, not discard it. Deleting messages is destructive and does not provide graceful shutdown. This approach fails to meet the goal and could lead to inconsistent processing results.
Go deeper
Related to this question
Learn chapter
Compute Engine Machine Types and Families
Key term
Pub/Sub
Pub/Sub is a messaging pattern where publishers send messages without knowing who receives them, and subscribers receive only the messages they care about.
Key term
Cloud storage
Cloud storage is a service that lets you save data on remote servers accessed over the internet instead of on your computer's hard drive.
About these practice questions
This ACE question is part of Courseiva's 775-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Google Cloud exam blueprint
This ACE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ACE exam.