Skip to content

Commit

Permalink
session: avoid unnecessary timeouts
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
baloo committed Jan 23, 2025
1 parent 12b25dd commit b04249c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b04249c

Please sign in to comment.