From b04249c969b24ecbc723550592b6b7d02be518a4 Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Wed, 3 Jul 2024 15:24:48 -0700 Subject: [PATCH] session: avoid unnecessary timeouts When a slow operation is running on the HSM (like a RSA key generation >= 3072), the HSM will be busy for more than the session timeout of 30seconds. Although the device did not reply within timeout, it did not discard the session, and we should not either. This bumps the last_active when we receive a reply from the HSM. --- src/session.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/session.rs b/src/session.rs index 6bd14231..fe647f84 100644 --- a/src/session.rs +++ b/src/session.rs @@ -225,6 +225,7 @@ impl Session { return Err(e.into()); } }; + self.last_active = Instant::now(); if response.is_err() { session_error!(self, "uuid={} error={:?}", &uuid, response.code);