A case missed in bug 26204.
Merge bug26326
Fix typo spotted by Edwin Fine.

Since hitting this line would cause a crash in the caller, and since this code is used very heavily (e.g. in the gen_server2 prioritised mailbox) and since it's been like that for over a year, I can only conclude that this code is unreachable. That conclusion is backed up by trying to get a pqueue() into a state which would hit that head - I was not able to. Still, it should be fixed...
stable to default
Sigh. The type of the 4th argument to application:set_env/4 has changed in Erlang 17 from being non_neg_integer() | 'infinity' to a proplist of options. And earlier versions of Erlang do not appreciate a proplist here! So just stop using it (yes, 5s timeout, but we have lots of calls to set_env/3 in the tests already and they do not seem to fail).
Fix type error (introed in 24926 I think) spotted by Dialyzer.
Dialyzer points out that the false branch cannot happen. In bug 26204 we removed that distinction (cancelling an already fired timer); cancel_timer now only returns 'ok'.
Handle exceptions when connection_state = 'starting' the same way we do for 'tuning'
Use a catch-all fn head instead
...and inline that again.
Merge bug26313 (again)
stable to default
Changelogs for 3.3.5.
Added tag rabbitmq_v3_3_5 for changeset 3347a7f0e689
stable to default
Simplify maintenance of persistent_count on ack and purge:

* Don't parameterise remove_queue_entries/5 with a fold function, there's
  only one call site.
* Get remove_queue_entries/4 / purge_betas_and_deltas/3 to update persistent
  count directly, not removed counts by store.
* Update persistent count in one place in remove_pending_ack/2, not many
  places in ack/2.
* Remove a couple of no-longer needed helpers.
Maybe a tad clearer?
Merge bug26335
Merge in default
Oops