Spotted while investigating
ENTMQCL-2681 , which contains the [client] protocol trace logs.
In case of a router doing link routing to a broker, which goes away during an error handling test, the router can then need to refuse new links and/or kill existing links as it has nowhere to route them. That is all to be expected.
When failing to attach some sender links though, it was observed the router in one case did not response to a clients attach at all, and in a second case incorrectly sent a response attach with a populated target, having address = null, followed by a detach with error (which looks to lead to some unexpected client behaviour as it was mislead into thinking the producer actually opened, likely exposing a separate client issue).
The attach in the second case should have had target=null, rather than a null address, to indicate that this was a link refusal and the detach with error would follow:
In a third related instant earlier in the testing, the router did actually do the correct thing while returning a [different] error, ommitting the attach target entirely as is directed by the protocol spec:
NOTE: actual address was replaced with 'destination' in the above traces.