Commit 4bf01f0
committed
Fix nil pointer dereference in BM25Strategy.watchLoop during session teardown
Capture the watcher reference as a local variable at goroutine start to
avoid racing with Close() which sets s.watcher = nil under watcherMu.
Also add a nil guard before calling addPathToWatcher on Create events.
This matches the fix already applied to VectorStore.watchLoop.
Assisted-By: docker-agent1 parent 9dfb2e8 commit 4bf01f0
1 file changed
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
672 | 672 | | |
673 | 673 | | |
674 | 674 | | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
675 | 684 | | |
676 | 685 | | |
677 | 686 | | |
| |||
735 | 744 | | |
736 | 745 | | |
737 | 746 | | |
738 | | - | |
| 747 | + | |
739 | 748 | | |
740 | 749 | | |
741 | 750 | | |
| |||
746 | 755 | | |
747 | 756 | | |
748 | 757 | | |
749 | | - | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
750 | 761 | | |
751 | 762 | | |
752 | 763 | | |
| |||
769 | 780 | | |
770 | 781 | | |
771 | 782 | | |
772 | | - | |
| 783 | + | |
773 | 784 | | |
774 | 785 | | |
775 | 786 | | |
| |||
0 commit comments