exam questions

Exam Professional Cloud Developer All Questions

View all questions & answers for the Professional Cloud Developer exam

Exam Professional Cloud Developer topic 1 question 237 discussion

Actual exam question from Google's Professional Cloud Developer
Question #: 237
Topic #: 1
[All Professional Cloud Developer Questions]

You noticed that your application was forcefully shut down during a Deployment update in Google Kubernetes Engine. Your application didn’t close the database connection before it was terminated. You want to update your application to make sure that it completes a graceful shutdown. What should you do?

  • A. Update your code to process a received SIGTERM signal to gracefully disconnect from the database.
  • B. Configure a PodDisruptionBudget to prevent the Pod from being forcefully shut down.
  • C. Increase the terminationGracePeriodSeconds for your application.
  • D. Configure a PreStop hook to shut down your application.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
__rajan__
1 year, 1 month ago
Selected Answer: A
This is the most direct and effective way to ensure that your application completes a graceful shutdown. When your application receives a SIGTERM signal, it should use this signal as a trigger to disconnect from the database and complete any other necessary tasks before terminating.
upvoted 1 times
...
purushi
1 year, 2 months ago
Selected Answer: A
A is right. After caching the SIGTERM event that raised by Pod shutdown, we need to release the DB connection.
upvoted 1 times
...
closer89
1 year, 6 months ago
Selected Answer: A
A is a best practice https://cloud.google.com/blog/products/containers-kubernetes/kubernetes-best-practices-terminating-with-grace
upvoted 2 times
...
Pime13
1 year, 8 months ago
Selected Answer: A
https://cloud.google.com/blog/products/containers-kubernetes/kubernetes-best-practices-terminating-with-grace
upvoted 1 times
...
Pime13
1 year, 8 months ago
Selected Answer: A
i would choose A
upvoted 1 times
...
mrvergara
1 year, 9 months ago
Selected Answer: A
While a PodDisruptionBudget can help protect a Pod from being forcibly terminated during a deployment update, it does not ensure a graceful shutdown of the application. Option A, updating the code to handle SIGTERM signals, is the recommended way to ensure a graceful shutdown in the event of a termination.
upvoted 2 times
mrvergara
1 year, 9 months ago
Here's a link to the official Kubernetes documentation on the SIGTERM signal: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks And here's a link to the official Kubernetes documentation on how to handle the SIGTERM signal in your application: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-a-graceful-shutdown-for-your-application
upvoted 1 times
...
...
TNT87
1 year, 9 months ago
Selected Answer: B
https://kubernetes.io/docs/concepts/workloads/pods/disruptions/#pod-disruption-budgets https://cloud.google.com/blog/products/containers-kubernetes/kubernetes-best-practices-terminating-with-grace
upvoted 1 times
NewComer200
1 year, 6 months ago
I think Mr. TNT87 is very exceed person, because I know he answered very exellent answer in other questions. But this question's demand is "You want to update your application to make sure that it completes a graceful shutdown.". It's not about avoiding shutdown. I think the answer is what you should do in occuring shutdown. So me too, I think "to prevent the Pod from being forcefully shut dow n." doesn't anser for demand. I think also right answer is A.
upvoted 3 times
...
mrvergara
1 year, 9 months ago
Option B, Configuring a PodDisruptionBudget, is used to control the number of replicas of a pod that can be down simultaneously. It prevents voluntary disruption of the pods, but it does not prevent forced termination of the pods. When a pod is terminated forcefully, for example, during a node failure, the PodDisruptionBudget does not come into play. In this scenario, you need to handle the termination gracefully in your application code, as described in option A.
upvoted 3 times
TNT87
1 year, 8 months ago
As i said i passed my exam already
upvoted 1 times
wanrltw
10 months, 3 weeks ago
Have you passed the exam scoring 100% and it has had this particular question? Cause if not, you're just talking smack - GCP exams do not show where exactly you were wrong, so even if you passed it successfully it doesn't mean that you're right in this exact question.
upvoted 1 times
...
mrvergara
1 year, 8 months ago
And you don't want other people passing the exam? Because this option B seems to be wrong to me
upvoted 7 times
TNT87
1 year, 8 months ago
According to you and who are you?? stay away from baseless arguments they dnt benefit you with anything
upvoted 2 times
...
...
...
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago