Commit 39fefb9
bug: Fakeclient: Fix dataraces when writing to the scheme
We have a scheme write lock but plenty of other codeptaths that read
from the scheme and that don't do looking, resulting in dataraces if the
two happen in parallel.
This change introduces a simple RW lock and makes the fakeclient acquire
read locking for all its operations except when needing the write lock.
This isn't particularly smart, but given that we only have one codepath
that writes to the scheme, it seems good enough.1 parent 44bed88 commit 39fefb9
2 files changed
+108
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
| 78 | + | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
| 515 | + | |
| 516 | + | |
515 | 517 | | |
516 | 518 | | |
517 | 519 | | |
| |||
561 | 563 | | |
562 | 564 | | |
563 | 565 | | |
| 566 | + | |
| 567 | + | |
564 | 568 | | |
565 | 569 | | |
566 | 570 | | |
| |||
573 | 577 | | |
574 | 578 | | |
575 | 579 | | |
576 | | - | |
| 580 | + | |
| 581 | + | |
577 | 582 | | |
578 | | - | |
| 583 | + | |
| 584 | + | |
579 | 585 | | |
580 | 586 | | |
581 | 587 | | |
| |||
726 | 732 | | |
727 | 733 | | |
728 | 734 | | |
| 735 | + | |
| 736 | + | |
729 | 737 | | |
730 | 738 | | |
731 | 739 | | |
| |||
762 | 770 | | |
763 | 771 | | |
764 | 772 | | |
| 773 | + | |
| 774 | + | |
765 | 775 | | |
766 | 776 | | |
767 | 777 | | |
| |||
807 | 817 | | |
808 | 818 | | |
809 | 819 | | |
| 820 | + | |
| 821 | + | |
810 | 822 | | |
811 | 823 | | |
812 | 824 | | |
| |||
856 | 868 | | |
857 | 869 | | |
858 | 870 | | |
| 871 | + | |
| 872 | + | |
859 | 873 | | |
860 | 874 | | |
861 | 875 | | |
| |||
884 | 898 | | |
885 | 899 | | |
886 | 900 | | |
| 901 | + | |
| 902 | + | |
887 | 903 | | |
888 | 904 | | |
889 | 905 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2516 | 2516 | | |
2517 | 2517 | | |
2518 | 2518 | | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
| 2539 | + | |
| 2540 | + | |
| 2541 | + | |
| 2542 | + | |
| 2543 | + | |
| 2544 | + | |
| 2545 | + | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
| 2562 | + | |
| 2563 | + | |
| 2564 | + | |
| 2565 | + | |
| 2566 | + | |
| 2567 | + | |
| 2568 | + | |
| 2569 | + | |
| 2570 | + | |
| 2571 | + | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
| 2596 | + | |
| 2597 | + | |
| 2598 | + | |
| 2599 | + | |
| 2600 | + | |
| 2601 | + | |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
2519 | 2606 | | |
2520 | 2607 | | |
2521 | 2608 | | |
| |||
2604 | 2691 | | |
2605 | 2692 | | |
2606 | 2693 | | |
| 2694 | + | |
2607 | 2695 | | |
2608 | 2696 | | |
2609 | 2697 | | |
| |||
0 commit comments