Commit bcd6c1d
authored
Fix race in AbstractSearchAsyncAction request throttling (#116264)
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 3b2021f commit bcd6c1d
File tree
2 files changed
+12
-8
lines changed- server/src/main/java/org/elasticsearch/action/search
2 files changed
+12
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | 240 | | |
244 | 241 | | |
245 | 242 | | |
| |||
Lines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | | - | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
751 | 751 | | |
752 | 752 | | |
753 | 753 | | |
754 | | - | |
| 754 | + | |
755 | 755 | | |
756 | 756 | | |
757 | 757 | | |
| |||
770 | 770 | | |
771 | 771 | | |
772 | 772 | | |
773 | | - | |
774 | 773 | | |
775 | 774 | | |
776 | 775 | | |
777 | | - | |
| 776 | + | |
778 | 777 | | |
779 | 778 | | |
780 | 779 | | |
| |||
797 | 796 | | |
798 | 797 | | |
799 | 798 | | |
800 | | - | |
| 799 | + | |
801 | 800 | | |
802 | 801 | | |
803 | 802 | | |
804 | 803 | | |
805 | 804 | | |
806 | 805 | | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
807 | 814 | | |
808 | 815 | | |
809 | 816 | | |
| |||
0 commit comments