chunkify returns an empty list for the last chunk

RESOLVED FIXED

Status

RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: rail, Assigned: jlund)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

3 years ago
Hit this in staging where tried to chunkify locales and got [] for the last chunk

see https://gist.github.com/rail/74437aaa63835af095d1b4c3ba7d1f30
(Reporter)

Comment 1

3 years ago
chunkify([x for x in range(35)], 10, 10) is one of the examples
(Assignee)

Comment 2

3 years ago
in staging we tried 35 locales with 10 chunks. But I don't think this is limited to a small subset of total locales against 10 chunks.

afaict we are missing locales after we run chunkify for a variety of total locales: https://gist.github.com/lundjordan/db7dec7885b3d10b6cf9400c3b8268ae

oddly, 89 locales with 10 chunks works and that is what we have been using in our betas in production.. :)
(Assignee)

Comment 3

3 years ago
debugging the 35 locales 10 chunk case, it seems that chunkify does the right thing for the first few chunks..

it takes the 35locales/10chunks remainder (5) and distributes one locale on each of the first 5 chunks ('big_chunk's).

so it knows to put 4 locales in first 5 chunks, and 3 locales in the remaining. However, after the 6 chunk (one chunk greater than the first 5 big_chunks), things start to fall apart and we lose locales to holes in index/splicing.

my head hurts however trying to figure out why..
(Assignee)

Comment 4

3 years ago
Created attachment 8738841 [details] [review]
condition off whether or not this_chunk is one of the big_chunks or not
Attachment #8738841 - Flags: review?(bhearsum)
(Assignee)

Updated

3 years ago
Assignee: nobody → jlund
(Reporter)

Comment 5

3 years ago
Created attachment 8738856 [details] [review]
recursive approach

jinx, I have something to show too! :)
Attachment #8738856 - Flags: review?(bhearsum)
(Reporter)

Updated

3 years ago
Attachment #8738856 - Flags: review?(bhearsum)
Attachment #8738856 - Flags: review+
Attachment #8738856 - Flags: checked-in+
(Reporter)

Updated

3 years ago
Attachment #8738841 - Attachment is obsolete: true
Attachment #8738841 - Flags: review?(bhearsum)
(Reporter)

Comment 7

3 years ago
restarted releaserunner on bm83 and bm85
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.