Commit 18e3f1f
committed
Fix timestamp when recovering x-death header
This commit fixes a bug present in 3.13.3 which was introduced by
#11339
When an AMQP 0.9.1 client re-publishes a message with the x-death header
set, the `time` field was not converted from the AMQP 0.9.1 seconds
resolution to the internal millisecond resolution of `mc` fields
`first_time` and `last_time`.
Additionally, this commit will ignore invalid `time` fields sent in the
`x-death` header from AMQP 0.9.1 clients as reported in
https://rabbitmq.slack.com/archives/C1EDN83PA/p1719986557420719 which
results in the following crash later on when the message gets consumed:
```
supervisor: {<0.476725.0>,rabbit_channel_sup}
errorContext: child_terminated
reason: {badarith,
[{erlang,'div',
[<<"2024-07-02T02:58:50.000-07:00">>,1000],
[{error_info,#{module => erl_erts_errors}}]},
{mc_amqpl,death_table,7,[{file,"mc_amqpl.erl"},{line,806}]},
{lists,map,2,[{file,"lists.erl"},{line,1559}]},
{mc_amqpl,deaths_to_headers,2,
[{file,"mc_amqpl.erl"},{line,764}]},
{mc_amqpl,protocol_state,2,
[{file,"mc_amqpl.erl"},{line,406}]},
{rabbit_channel,handle_deliver0,4,
[{file,"rabbit_channel.erl"},{line,2685}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1594}]},
{rabbit_channel,handle_cast,2,
[{file,"rabbit_channel.erl"},{line,732}]}]}
```1 parent 7078e93 commit 18e3f1f
File tree
3 files changed
+18
-5
lines changed- deps/rabbit
- src
- test
3 files changed
+18
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
725 | 725 | | |
726 | 726 | | |
727 | 727 | | |
728 | | - | |
| 728 | + | |
| 729 | + | |
729 | 730 | | |
730 | | - | |
| 731 | + | |
| 732 | + | |
731 | 733 | | |
732 | 734 | | |
733 | 735 | | |
734 | | - | |
| 736 | + | |
735 | 737 | | |
736 | 738 | | |
737 | 739 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1598 | 1598 | | |
1599 | 1599 | | |
1600 | 1600 | | |
| 1601 | + | |
1601 | 1602 | | |
1602 | 1603 | | |
1603 | 1604 | | |
| |||
1610 | 1611 | | |
1611 | 1612 | | |
1612 | 1613 | | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
1613 | 1618 | | |
1614 | 1619 | | |
1615 | 1620 | | |
| |||
1623 | 1628 | | |
1624 | 1629 | | |
1625 | 1630 | | |
1626 | | - | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
1627 | 1635 | | |
1628 | 1636 | | |
1629 | 1637 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| 248 | + | |
248 | 249 | | |
249 | 250 | | |
250 | 251 | | |
| |||
273 | 274 | | |
274 | 275 | | |
275 | 276 | | |
276 | | - | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
277 | 280 | | |
278 | 281 | | |
279 | 282 | | |
| |||
0 commit comments