PAHMA-979: incremental improvements to queue handling