Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions sdks/python/apache_beam/io/requestresponse.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def process(self, request: RequestT, *args, **kwargs):
self._metrics_collector.requests.inc(1)

is_throttled_request = False
if self._throttler:
if self._throttler is not None:
while self._throttler.throttler.throttle_request(time.time() *
MSEC_TO_SEC):
_LOGGER.info(
Expand All @@ -375,7 +375,8 @@ def process(self, request: RequestT, *args, **kwargs):
response = self._repeater.repeat(
self._caller, request, self._timeout, self._metrics_collector)
self._metrics_collector.responses.inc(1)
self._throttler.throttler.successful_request(req_time * MSEC_TO_SEC)
if self._throttler is not None:
self._throttler.throttler.successful_request(req_time * MSEC_TO_SEC)
yield response
except Exception as e:
raise e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -619,9 +619,10 @@ def batch_validator_keyed_tensor_inference_fn(
inference_args,
model_id,
):
if len(batch) != 2:
if len(batch) > 2:
raise Exception(
f'Expected batch of size 2, received batch of size {len(batch)}')
'Expected batch size 1 or 2, received batch of size '
f'{len(batch)}')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we including this change? It seems like this changes the meaning of the test (incorrectly)

In general, it is better to keep PRs focused on a single task

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@damccorm Sorry, this might come from incorrect branching on my behalf. Let me push the fix in the next hour.

return default_keyed_tensor_inference_fn(
batch, model, device, inference_args, model_id)

Expand Down
2 changes: 1 addition & 1 deletion sdks/python/apache_beam/transforms/async_dofn_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ def test_reset_state_concurrent_teardown(self):
target=AsyncTest._run_reset_state_concurrent_teardown,
args=(self.use_asyncio, ))
p.start()
p.join(timeout=10.0)
p.join(timeout=30.0)

if p.is_alive():
p.terminate()
Expand Down
Loading