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

(WIP) V0.12.0.x Locks fixes #491

Merged
merged 2 commits into from
Aug 8, 2015
Merged

(WIP) V0.12.0.x Locks fixes #491

merged 2 commits into from
Aug 8, 2015

Conversation

UdjinM6
Copy link

@UdjinM6 UdjinM6 commented Aug 8, 2015

Another attempt to fix locking issue. Same ideas as #489 but will actually lock right when it can instead of standalone checks so applied directly only in specific places.

  • trylock for updateDarksendProgress, checkBalanceChanged, "block"
  • trylock+wait for UnlockCoins, SendDarksendDenominate, ProcessNewBlock, ActivateBestChain
  • move cs_darksend trylock in DoAutomaticDenominating lower, remove explicit lock

Looks good so far...
I think patching in few most common "hung" places with

    while(true) {
        TRY_LOCK(cs_main, lockMain);
        if(!lockMain) { MilliSleep(10); continue; }
        ...
        break;
    }

is a quite safe way to go.

Testing anyone? :)

- trylock for updateDarksendProgress, checkBalanceChanged, "block"
- trylock+wait for UnlockCoins, SendDarksendDenominate, ProcessNewBlock, ActivateBestChain
- move trylock in DoAutomaticDenominating lower
@UdjinM6 UdjinM6 added this to the 12.0 milestone Aug 8, 2015
@UdjinM6 UdjinM6 changed the title V0.12.0.x Locks fixes (WIP) V0.12.0.x Locks fixes Aug 8, 2015
@UdjinM6
Copy link
Author

UdjinM6 commented Aug 8, 2015

Hang again :(

  • Limited cs_wallet scope in PrepareDarksendDenominate

Starting mixing with this fix...

PS. Added WIP to title, do not merge yet

eduffield222 pushed a commit that referenced this pull request Aug 8, 2015
@eduffield222 eduffield222 merged commit b67d049 into dashpay:v0.12.0.x Aug 8, 2015
@eduffield222
Copy link

I'm merging this because my clients are hanging too and I'd rather not duplicate the work you're already doing 👍

@eduffield222
Copy link

I just had a hang, here's the last debug logs:

2015-08-08 19:01:34 POTENTIAL DEADLOCK DETECTED
2015-08-08 19:01:34 Previous lock order was:
2015-08-08 19:01:34 (1) pwalletMain->cs_wallet activemasternode.cpp:347
2015-08-08 19:01:34 (2) cs_main wallet.cpp:1494
2015-08-08 19:01:34 Current lock order is:
2015-08-08 19:01:34 (2) cs_main main.cpp:2620
2015-08-08 19:01:34 (2) cs_main wallet.cpp:773
2015-08-08 19:01:34 (1) cs_wallet wallet.cpp:773

2015-08-08 19:01:34 LOCKCONTENTION: cs_main
2015-08-08 19:01:34 Locker: wallet.cpp:1494
2015-08-08 19:01:34 LOCKCONTENTION: cs_wallet
2015-08-08 19:01:34 Locker: wallet.cpp:2983
2015-08-08 19:01:46 LOCKCONTENTION: cs_main
2015-08-08 19:01:46 Locker: rpcserver.cpp:1020
2015-08-08 19:01:57 LOCKCONTENTION: cs_main
2015-08-08 19:01:57 Locker: main.cpp:305
2015-08-08 19:02:15 LOCKCONTENTION: cs_main
2015-08-08 19:02:15 Locker: rpcserver.cpp:1020
2015-08-08 19:02:56 LOCKCONTENTION: cs_main
2015-08-08 19:02:56 Locker: rpcserver.cpp:1020

@UdjinM6 UdjinM6 mentioned this pull request Aug 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants