Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Fix map reduce infinite loop error #348

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dillonwelch
Copy link

Quoting from q-centrix#6:

Duplicate :medications information was causing the map_fn for Child Immunization Status (40280381-4555-E1C1-0145-D7C003364261) to go into an infinite loop during mongo's mapreduce, eating up 100% CPU, and eventually causing a memory leak. Although the BulkRecordImporter calls PatientImporter which calls Record's dedup_record! method, the :medications sections still were not being deduped. This fix uses ruby's uniq method to dedupe :medications rather than using more domain-specific approaches. This fixes the infinite loop error, and turns the corresponding Cypress tests green.

It looks like this measure was skipped in Cypress for a while: projectcypress/cypress@450178b

Someone else commenting with the same issue: WorldVistA/popHealth#1 (comment)

Identified as an issue by the pophealth team: http://issues.osehra.org/browse/POP-270

Please let me know if this is not the correct approach! I am using these commits in a fork currently and would like to update if there's a better solution.

Conroy Whitney and Jason Harrison added 3 commits January 25, 2016 16:49
Duplicate `:medications` information was causing the `map_fn` for `Child Immunization Status (40280381-4555-E1C1-0145-D7C003364261)` to go into an infinite loop during mongo's mapreduce, eating up 100% CPU, and eventually causing a memory leak. Although the `BulkRecordImporter` calls `PatientImporter` which calls `Record`'s `dedup_record!` method, the `:medications` sections still were not being deduped. This fix uses ruby's `uniq` method to dedupe `:medications` rather than using more domain-specific approaches. This fixes the infinite loop error, and turns the corresponding Cypress tests green.
 * Rename `dedup_section_naively!`
 * Add fixture of duplicated medications patient
 * Add MiniTest to ensure `dudup_record!` works as expected
Continuous integration seems to have a problem finding the record we need to run `test_dedup_section_naively`. Adding loading of collection fixtures in `setup` method.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant