Commit 89faa41
authored
[dpc-4710] Shuts down dpc-queue after AggregationEngine (#2708)
## 🎫 Ticket
https://jira.cms.gov/browse/DPC-4710
Bugfix for #2706
## 🛠 Changes
Updated the order that `DPCQueueHibernateModule` and
`AggregationAppModule` are added to the `DPCAggregationService`.
## ℹ️ Context
DropWizard shuts these modules down in the opposite order they are
added, and we don't want the queue to shutdown until after the
aggregation engine has finished processing or it won't be able to update
its last batch.
This wasn't caught in initial testing for two reasons:
1. Our tests used the `MemoryBatchQueue` which doesn't connect to an
external DB.
2. Our code was ignoring the errors when it tried to pause a batch
instead of logging them.
## 🧪 Validation
1. Go into your local queue DB and pick out your most recently completed
batch.
2. Update the batch's `status` to 0 (_queued_), its `aggregator_id` to
`null`, and its patient to `9S99EU8XY92`. (this patient tells
MockBfdClient to hang forever, simulating a long running patient)
3. Start up dpc-aggregation and it will pick up the batch and set its
status to 1 (_running_).
4. Stop dpc-aggregation.
If you do this on the current main branch, the status of the batch will
still be 1 (_running_). If you recompile from this branch and go through
the same process the batch will be reset to 0 (_queued_), which is what
we want.1 parent 3185945 commit 89faa41
File tree
5 files changed
+95
-11
lines changed- dpc-aggregation/src
- main/java/gov/cms/dpc/aggregation
- engine
- test
- java/gov/cms/dpc/aggregation
- resources
- dpc-queue/src/main/java/gov/cms/dpc/queue
5 files changed
+95
-11
lines changedLines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | | - | |
47 | | - | |
| 49 | + | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
100 | 103 | | |
101 | 104 | | |
102 | 105 | | |
| |||
Lines changed: 54 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
4 | 12 | | |
5 | 13 | | |
6 | 14 | | |
7 | 15 | | |
8 | | - | |
9 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
10 | 20 | | |
11 | 21 | | |
12 | 22 | | |
| 23 | + | |
| 24 | + | |
13 | 25 | | |
| 26 | + | |
14 | 27 | | |
15 | | - | |
16 | | - | |
| 28 | + | |
| 29 | + | |
17 | 30 | | |
18 | 31 | | |
19 | 32 | | |
| |||
25 | 38 | | |
26 | 39 | | |
27 | 40 | | |
28 | | - | |
29 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
30 | 49 | | |
31 | 50 | | |
32 | 51 | | |
33 | | - | |
34 | | - | |
| 52 | + | |
| 53 | + | |
35 | 54 | | |
36 | 55 | | |
37 | 56 | | |
| |||
48 | 67 | | |
49 | 68 | | |
50 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
51 | 97 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
| 243 | + | |
242 | 244 | | |
243 | 245 | | |
244 | 246 | | |
| |||
0 commit comments