Start here. This is the direct spoken answer to practice first.
Why this question matters
A lock or visibility timeout grants temporary processing ownership, not exactly-once execution. If work outlives that ownership, another worker may receive the message while the first attempt is still running.
I compare the message lock or visibility timeout with real processing duration. If work can exceed it, I either renew ownership, split the job into bounded checkpointed steps, or use a durable job record that short messages advance. Renewal can fail and settlement can be lost, so the handler remains idempotent. Once ownership is lost, the worker stops starting new effects and uses durable state to decide whether an in-flight effect can finish safely.