Commit 205675d
authored
Fix race in AbstractSearchAsyncAction request throttling (elastic#116264) (elastic#117638)
We had a race here where the non-blocking pending execution
would be starved of executing threads.
This happened when all the current holders of permits from the semaphore
would release their permit after a producer thread failed to acquire a
permit and then enqueued its task.
=> need to peek the queue again after releasing the permit and try to
acquire a new permit if there's work left to be done to avoid this
scenario.1 parent 74c760f commit 205675d
File tree
1 file changed
+12
-5
lines changed- server/src/main/java/org/elasticsearch/action/search
1 file changed
+12
-5
lines changedLines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | | - | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
792 | 792 | | |
793 | 793 | | |
794 | 794 | | |
795 | | - | |
| 795 | + | |
796 | 796 | | |
797 | 797 | | |
798 | 798 | | |
| |||
811 | 811 | | |
812 | 812 | | |
813 | 813 | | |
814 | | - | |
815 | 814 | | |
816 | 815 | | |
817 | 816 | | |
818 | | - | |
| 817 | + | |
819 | 818 | | |
820 | 819 | | |
821 | 820 | | |
| |||
838 | 837 | | |
839 | 838 | | |
840 | 839 | | |
841 | | - | |
| 840 | + | |
842 | 841 | | |
843 | 842 | | |
844 | 843 | | |
845 | 844 | | |
846 | 845 | | |
847 | 846 | | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
848 | 855 | | |
849 | 856 | | |
850 | 857 | | |
| |||
0 commit comments