title: In postgres, does an advisory lock expire after a set time or does the session expire in idle automatically?
body: <p>I have a need to hang on to an advisory lock for about 30 seconds while my application instances come online. I noticed that if I do a <code>setTimeout</code> with a callback to release the lock, with 30 seconds or more, I get a warning that I don't own a lock of type ExclusiveLock. (If I call setTimeout with 10 seconds, this doesn't happen)</p>
  
  <pre class="lang-js prettyprint-override"><code>    setTimeout(async () =&gt; {
        try {
          await sync.tryLockRelease(lockName) // call to pg_advisory_unlock(id);
          log.info(`${metadataKey}: lock released`)
        } catch (err) {
          log.error(`${metadataKey}: could not release lock: ${err.message}`, err)
        }
      }, 30000)
  </code></pre>
  
  <p>If I add an interval that queries the DB every second, this problem doesn't happen. This leads me to believe that the session is being culled at some time greater than 10 seconds.</p>