From 12dd2bb650a7762ff77e495535a3d517d558f4c8 Mon Sep 17 00:00:00 2001 From: Sam Goldman Date: Fri, 15 Feb 2019 13:40:35 -0800 Subject: [PATCH] Use unblocked files, not components, to determine bucket sizes Summary: In D8758296 I changed the max_bucket_size constant to mean the number of files in a bucket rather than the number of components. However, I did not correctly update the logic to calculate the actual bucket size. The logic error became clear in D13972924 where I refactored the code to use the name `ready_components` instead of `jobs`. We are comparing files and components, when we should be comparing files and files. Reviewed By: nmote Differential Revision: D13993319 fbshipit-source-id: fdc7d4d7075b6e06fb60618457248cc7dae61479 --- src/services/inference/merge_stream.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/inference/merge_stream.ml b/src/services/inference/merge_stream.ml index 59620fa2de1..5e2fab0cf74 100644 --- a/src/services/inference/merge_stream.ml +++ b/src/services/inference/merge_stream.ml @@ -82,11 +82,11 @@ let max_bucket_size = 500 let bucket_size stream = (* NB: num_workers can be zero *) let max_bucket_size = - if stream.ready_components < stream.num_workers * max_bucket_size - then 1 + (stream.ready_components / stream.num_workers) + if stream.ready_files < stream.num_workers * max_bucket_size + then 1 + (stream.ready_files / stream.num_workers) else max_bucket_size in - min max_bucket_size stream.ready_components + min max_bucket_size stream.ready_files let is_done stream = stream.blocked_components = 0