[Bugfix]: fix issue with n>1 sampling on v1 requests overriding each other (#16863)

Signed-off-by: Jeffrey Li <jeffrey.dot.li@gmail.com>
This commit is contained in:
Jeffrey Li
2025-04-22 11:40:19 +08:00
committed by GitHub
parent 1311913f55
commit 0e4254492f
3 changed files with 104 additions and 20 deletions
+3 -6
View File
@@ -37,12 +37,9 @@ class RequestOutputCollector:
self.output = output
self.ready.set()
elif isinstance(self.output, RequestOutput):
if self.aggregate:
# Coalesce the outputs in delta case.
self.output.add(output)
else:
# Just replace latest in non-delta case.
self.output = output
# This ensures that request outputs with different request indexes
# (if n > 1) do not override each other.
self.output.add(output, aggregate=self.aggregate)
async def get(self) -> RequestOutput:
"""Get operation blocks on put event."""