Resolve "Semaphore timeout" errors in ShadowProtect

Written By Tami Sutcliffe (Super Administrator)

Updated at August 23rd, 2021

          Error in ShadowProtect:
          Cannot take snapshot (The semaphore timeout period has expired.        

          0x80070079(2147942521)) - retry in 30 seconds

What is a Semaphore Timeout?

By definition, semaphore means "a system of sending messages by holding the arms or two flags or poles in certain positions according to an alphabetic code." In the computing world, this becomes the method by which various software, services, or tasks running on a given machine communicate with each other to indicate status. Think of it like a traffic cop - you may stop, you may go - ensuring that traffic doesn't run into each other, and only one car (or process) goes at a time.

A semaphore lock or hold can be used to ensure that another process doesn't attempt to access something while an action is being processed. This ensures that a process does not occur during the execution of another process, which could potentially cause catastrophic failure.

A semaphore timeout occurs when a process attempts to complete, and finds a semaphore lock already in place.

  • The process can wait for the semaphore lock to be removed and then proceed, in which case the process appears slow to respond, (although it does eventually complete.)
  • Alternatively, the process either waits as long as it can, or cannot wait, which is when the semaphore timeout failure is returned 

Semaphores and semaphore timeouts are specific to Windows -  as opposed to being specific to any particular software or process. (Other operating systems may sometimes utilize semaphore.) Semaphore timeouts are often seen in relation to backup solutions, as well as when files are being copied or moved. However, semaphore timeouts are definitely not limited to only these type of processes. They can also be seen in relation to DNS resolution and TCP/IP transport and communication.

Reasons for Semaphore Timeouts?

Semaphore timeouts are most often caused by a heavy load on the server. While this is not the only reason you might encounter a semaphore timeout, it is the most likely situation related to backup solutions.

Other reasons include

  • a process crashing before the semaphore hold was released
  • a semaphore deadlock (which occurs when two separate processes require the same semaphore locks. If these two processes initiate the semaphore locks in the opposite order, they will deadlock with each other, each holding their first semaphore lock while waiting for the other to release a lock so they can continue on with their process)
  • semaphore lock failure during the execution of a process causing the process to hang or crash
  • improper settings for that particular process within a given environment.

Semaphore Timeouts and VSS

Semaphore timeouts are often seen in relation to VSS processes, and will often include the Microsoft errors 0x80070079, 0x80042314, or 0x80042314.

Addressing Semaphore Timeouts in ShadowProtect

Within ShadowProtect, you may see this error "Cannot take snapshot (The semaphore timeout period has expired. 0x80070079(2147942521)) - retry in 30 seconds". To resolve this:

  1. See the ShadowProtect Tuning Guide:
    Ensure you make the suggested changes. This will help the processes run as smoothly as possible, and should help eliminate any semaphore timeouts you might see
  2. Check to see if the timeouts are occurring at specific times. If so, this could be due to other resource-intensive processes occurring at the same time. If you find this is the issue, adjust those processes and/or your backup schedule to ensure the two do not conflict.
  3. Ensure that the machine has adequate resources.  If none of the above steps resolve the issue, it may be that the machine does not have adequate resources to properly run the backup.
  4. If you have made all the changes above, complete an SPDiag and send the logs to support: