Skip to content

Conversation

@jtguggedal
Copy link
Contributor

Add batch session timeout to address the scenario where a module opens a batch session and never closes it.
During this, no data was stored and no session could be opened. At the same time, allow data storage while session is active.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a batch session timeout mechanism to the storage module to prevent scenarios where a module opens a batch session but never closes it, which would block other sessions and prevent data storage. The implementation includes a configurable timeout that automatically closes inactive sessions and enables data storage to continue while a session is active.

Key changes:

  • Added configurable batch session timeout with a default of 60 seconds
  • Implemented automatic session closure when timeout expires
  • Modified buffer state to allow data storage during active batch sessions

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
app/src/modules/storage/storage.c Core timeout implementation with work queue handler, state machine updates, and data handling during active sessions
app/src/modules/storage/Kconfig.storage Added configuration option for session timeout duration
tests/module/storage/CMakeLists.txt Added test configuration for the new timeout setting
tests/module/storage/src/storage_module_test.c Added comprehensive tests for timeout behavior and concurrent data storage

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Add batch session timeout to address the scenario where a
module opens a batch session and never closes it.
During this, no data was stored and no session could be opened.
At the same time, allow data storage while session is active.

Signed-off-by: Jan Tore Guggedal <[email protected]>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 6, 2026

@jtguggedal jtguggedal merged commit d883495 into main Jan 7, 2026
11 checks passed
@jtguggedal jtguggedal deleted the storage-timeout branch January 7, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants