[PR #2325] Fix problem with settings access #2767

Open
opened 2026-10-15 04:05:06 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/amnezia-vpn/amnezia-client/pull/2325
Author: @Vipon
Created: 3/7/2026
Status: 🔄 Open

Base: dev ← Head: vkonyche/fix/multithreads/settings


📝 Commits (1)

  • a35e188 The recursive mutex is overkill here.

📊 Changes

2 files changed (+13 additions, -6 deletions)

View changed files

📝 client/secure_qsettings.cpp (+12 -5)
📝 client/secure_qsettings.h (+1 -1)

📄 Description

To avoid potential deadlocks is enough to avoid sleeping in the critical sections. Sleeping in the critical sections is the root of potential problems, which allows to thread to be preempted with the locked mutex.

Critical sections in the methods setValue and value are only parts which touch settings and caches. So there is no any reasons to keep mutex locked all the time. Methods should prepare everything before touch the parts should be consistent.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/amnezia-vpn/amnezia-client/pull/2325 **Author:** [@Vipon](https://github.com/Vipon) **Created:** 3/7/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `vkonyche/fix/multithreads/settings` --- ### 📝 Commits (1) - [`a35e188`](https://github.com/amnezia-vpn/amnezia-client/commit/a35e1880cee53bdc598e4bc1e395f2e1907b9bbd) The recursive mutex is overkill here. ### 📊 Changes **2 files changed** (+13 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `client/secure_qsettings.cpp` (+12 -5) 📝 `client/secure_qsettings.h` (+1 -1) </details> ### 📄 Description To avoid potential deadlocks is enough to avoid sleeping in the critical sections. Sleeping in the critical sections is the root of potential problems, which allows to thread to be preempted with the locked mutex. Critical sections in the methods setValue and value are only parts which touch settings and caches. So there is no any reasons to keep mutex locked all the time. Methods should prepare everything before touch the parts should be consistent. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amnezia-client#2767
No description provided.