The queue code is missing some crucial logging and logs at the wrong level. One case logs an error as many times as the queue hierarchy is deep. This causes one error to be logged multiple times including stack traces. Code changes are limited to logging cleanup.
In the queue code the comments do not comply with the go best practice for function comments.