Skip to content

Conversation

@honeynil
Copy link
Contributor

Fixed a critical concurrency bug in the Err() method where defer was
calling RLock() instead of RUnlock(). This caused read locks to
accumulate without being released, leading to potential deadlocks when
CloseWithCause() attempted to acquire a write lock.

The bug could manifest in high-concurrency scenarios where multiple
goroutines call Err() while another attempts to call CloseWithCause().

Changes:

  • trm/drivers/is_closed.go:73: Changed defer a.mu.RLock() to defer a.mu.RUnlock()

@coveralls
Copy link
Collaborator

coveralls commented Oct 24, 2025

Pull Request Test Coverage Report for Build 18771899929

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 94.389%

Totals Coverage Status
Change from base Build 18256243043: 0.0%
Covered Lines: 1615
Relevant Lines: 1711

💛 - Coveralls

* extend test to catch this problem in the future
@maranqz
Copy link
Member

maranqz commented Oct 24, 2025

Thank you for catching and the fix. ❤️

I extended test and will release it in short time.

@maranqz maranqz merged commit f9e2958 into avito-tech:main Oct 24, 2025
18 checks passed
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.

3 participants