Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

store/mockstore: Some wg.Wait() operations may block forever #26805

Closed
BurtonQin opened this issue Aug 2, 2021 · 4 comments
Closed

store/mockstore: Some wg.Wait() operations may block forever #26805

BurtonQin opened this issue Aug 2, 2021 · 4 comments
Labels
sig/transaction SIG:Transaction type/question The issue belongs to a question. type/stale This issue has not been updated for a long time.

Comments

@BurtonQin
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

We found 2 blocking bugs through a WIP Fuzzing project by system-pclub, PSU.

2. What did you expect to see? (Required)

The wg.Wait() operation shall not block forever whatever the order of the concurrent messages.

3. What did you see instead (Required)

We found the 2 bugs by fuzzing the code from entry point:

func TestT(t *testing.T) {

  1. Blocked at Wait() in function acquireOne at
    if ok {
    w.Wait()
    waitCnt++
    continue
    }
  2. Blocked at Wait() in function Write at
    if len(wb.lockBatch.entries) > 0 {
    // We must delete lock after commit succeed, or there will be inconsistency.
    wb.lockBatch.wg.Add(1)
    writer.lockCh <- &wb.lockBatch
    wb.lockBatch.wg.Wait()
    return wb.lockBatch.err
    }

4. What is your TiDB version? (Required)

branch: master
commit: 7e6690d

@BurtonQin BurtonQin added the type/bug The issue is confirmed as a bug. label Aug 2, 2021
@ChenPeng2013 ChenPeng2013 added the sig/transaction SIG:Transaction label Aug 3, 2021
@ChenPeng2013
Copy link
Contributor

@sticnarf PTAL, is it a bug, thanks

@cfzjywxk cfzjywxk added type/question The issue belongs to a question. and removed type/bug The issue is confirmed as a bug. severity/major labels Aug 23, 2021
@charlesxsh
Copy link

Hi there, kindly ask do we have any update on this PR?

@sticnarf
Copy link
Contributor

sticnarf commented Oct 27, 2021

I don't have ideas about how this really happens at this time...

The mockstore is only used in tests instead of production. Probably these forever wg.Wait() are due to incomplete resource cleanups after tests.

Sorry, I'm afraid we will not spend much time investigating the issue unless it greatly affects daily development by decreasing the test success rate.

@jebter
Copy link

jebter commented Jun 6, 2024

The issue has not been updated for too long, so I will close it. If there are any updates, you can reopen it.

@jebter jebter closed this as completed Jun 6, 2024
@jebter jebter added the type/stale This issue has not been updated for a long time. label Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/transaction SIG:Transaction type/question The issue belongs to a question. type/stale This issue has not been updated for a long time.
Projects
None yet
Development

No branches or pull requests

6 participants