You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Michael Ivanov <iv...@logit-ag.de> on 2020/05/14 09:29:59 UTC

delete-on-close problem in python

Hallo,

I observe strange thing when using temporary queues in client.py script.
I assign delete-on-close policy to temporary queue as follows:

   options=DynamicNodeProperties({"lifetime-policy" : ['amqp:delete-on-close:list', []], "exclusive" : True })

But when I check the trace I see that delete-on-close is replaced by delete-on-no-link:

   [0x1759b60]:0 <- @attach(18) [name="67234240-c66b-4936-9498-e0e66013b355-6d4569a2-f9f7-43c1-b87a-6f99976e81d9", handle=1,
role=false, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40)
[address="67234240-c66b-4936-9498-e0e66013b355_67234240-c66b-4936-9498-e0e66013b355-6d4569a2-f9f7-43c1-b87a-6f99976e81d9",
durable=0, timeout=0, dynamic=false, dynamic-node-properties={:"supported-dist-modes"="move",
:"lifetime-policy"=@:"amqp:delete-on-no-links:list" [], :exclusive=true}, distribution-mode=:move], target=@target(41)
[durable=0, timeout=0, dynamic=false], initial-delivery-count=0, max-message-size=0]

When I assign same property in c++ code it is shown in trace correctly:

   [0xb37260]:0 <- @attach(18) [name="receiver-10599.0", handle=0, role=false, snd-settle-mode=2, rcv-settle-mode=0,
source=@source(40) [address="EB39BD71-C919-4936-A7C9-65334513620D_receiver-10599.0", durable=0, timeout=0, dynamic=false,
dynamic-node-properties={:"supported-dist-modes"="move", :"lifetime-policy"=@:"amqp:delete-on-close:list" [], :exclusive=true},
distribution-mode=:move], target=@target(41) [durable=0, timeout=0, dynamic=false], initial-delivery-count=0, max-message-size=0]

I grepped through proton 0.28 code for 'delete-' tokens but did not find anything
that looked like delete-on-close replacement.

Can you help me to find where the replacement occurs in python?

Best regards,
-- 
 \   / |			           |
 (OvO) |  Mikhail Iwanow                   |
 (^^^) |      Voice:   +7 (911) 223-1300   |
  \^/  |      E-mail:  ivans@logit-ag.de   |
  ^ ^  |                                   |

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: delete-on-close problem in python

Posted by Robbie Gemmell <ro...@gmail.com>.
On Thu, 14 May 2020 at 11:22, Gordon Sim <gs...@redhat.com> wrote:
>
> On 14/05/2020 10:29 am, Michael Ivanov wrote:
> > Hallo,
> >
> > I observe strange thing when using temporary queues in client.py script.
> > I assign delete-on-close policy to temporary queue as follows:
> >
> >     options=DynamicNodeProperties({"lifetime-policy" : ['amqp:delete-on-close:list', []], "exclusive" : True })
> >
> > But when I check the trace I see that delete-on-close is replaced by delete-on-no-link:
> >
> >     [0x1759b60]:0 <- @attach(18) [name="67234240-c66b-4936-9498-e0e66013b355-6d4569a2-f9f7-43c1-b87a-6f99976e81d9", handle=1,
> > role=false, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40)
> > [address="67234240-c66b-4936-9498-e0e66013b355_67234240-c66b-4936-9498-e0e66013b355-6d4569a2-f9f7-43c1-b87a-6f99976e81d9",
> > durable=0, timeout=0, dynamic=false, dynamic-node-properties={:"supported-dist-modes"="move",
> > :"lifetime-policy"=@:"amqp:delete-on-no-links:list" [], :exclusive=true}, distribution-mode=:move], target=@target(41)
> > [durable=0, timeout=0, dynamic=false], initial-delivery-count=0, max-message-size=0]
> >
> > When I assign same property in c++ code it is shown in trace correctly:
> >
> >     [0xb37260]:0 <- @attach(18) [name="receiver-10599.0", handle=0, role=false, snd-settle-mode=2, rcv-settle-mode=0,
> > source=@source(40) [address="EB39BD71-C919-4936-A7C9-65334513620D_receiver-10599.0", durable=0, timeout=0, dynamic=false,
> > dynamic-node-properties={:"supported-dist-modes"="move", :"lifetime-policy"=@:"amqp:delete-on-close:list" [], :exclusive=true},
> > distribution-mode=:move], target=@target(41) [durable=0, timeout=0, dynamic=false], initial-delivery-count=0, max-message-size=0]
> >
> > I grepped through proton 0.28 code for 'delete-' tokens but did not find anything
> > that looked like delete-on-close replacement.
> >
> > Can you help me to find where the replacement occurs in python?
>
> It is not being replaced, but your attempt to set it is failing as it
> needs to be a described type, and the default is used instead.
>
> Replace
>
>    ['amqp:delete-on-close:list', []]
>
> with
>
>    Described('amqp:delete-on-close:list', [])
>
> (The Described type is imported from the base proton module)
>
>

Ah, that makes sense. I had also figured the option setting was
slightly wrong but was still trying to figure out how exactly.
Initially I looked at whether it wasnt sending a symbol key in the
node properties map, but DynamicNodeProperties takes care of that it
seems, so had to be the other bit that was wrong, hadnt yet identified
how.

Since the traces are from the client side, these are the  'response'
attach if you will providing address etc details of a created dynamic
node, and whats shown is the server picking something else in its
repsonse rather than proton changing anything. Thus it seemed most
likely the value being set at the client was wrong.

Robbie

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: delete-on-close problem in python

Posted by Michael Ivanov <iv...@isle.spb.ru>.
It worked!

Well almost. The correct 'delete-on-close' entry should look as follows:

   Described(symbol('amqp:delete-on-close:list'), [])

It seems it does not do implicit conversion of string to symbol when passed
as argument to Described()

Thanks and regards!

On 14.05.2020 13:22, Gordon Sim wrote:
> On 14/05/2020 10:29 am, Michael Ivanov wrote:
>> Hallo,
>>
>> I observe strange thing when using temporary queues in client.py script.
>> I assign delete-on-close policy to temporary queue as follows:
>>
>>     options=DynamicNodeProperties({"lifetime-policy" : ['amqp:delete-on-close:list', []], "exclusive" : True })
>>
>> But when I check the trace I see that delete-on-close is replaced by delete-on-no-link:
>>
>>     [0x1759b60]:0 <- @attach(18) [name="67234240-c66b-4936-9498-e0e66013b355-6d4569a2-f9f7-43c1-b87a-6f99976e81d9", handle=1,
>> role=false, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40)
>> [address="67234240-c66b-4936-9498-e0e66013b355_67234240-c66b-4936-9498-e0e66013b355-6d4569a2-f9f7-43c1-b87a-6f99976e81d9",
>> durable=0, timeout=0, dynamic=false, dynamic-node-properties={:"supported-dist-modes"="move",
>> :"lifetime-policy"=@:"amqp:delete-on-no-links:list" [], :exclusive=true}, distribution-mode=:move], target=@target(41)
>> [durable=0, timeout=0, dynamic=false], initial-delivery-count=0, max-message-size=0]
>>
>> When I assign same property in c++ code it is shown in trace correctly:
>>
>>     [0xb37260]:0 <- @attach(18) [name="receiver-10599.0", handle=0, role=false, snd-settle-mode=2, rcv-settle-mode=0,
>> source=@source(40) [address="EB39BD71-C919-4936-A7C9-65334513620D_receiver-10599.0", durable=0, timeout=0, dynamic=false,
>> dynamic-node-properties={:"supported-dist-modes"="move", :"lifetime-policy"=@:"amqp:delete-on-close:list" [], :exclusive=true},
>> distribution-mode=:move], target=@target(41) [durable=0, timeout=0, dynamic=false], initial-delivery-count=0, max-message-size=0]
>>
>> I grepped through proton 0.28 code for 'delete-' tokens but did not find anything
>> that looked like delete-on-close replacement.
>>
>> Can you help me to find where the replacement occurs in python?
> 
> It is not being replaced, but your attempt to set it is failing as it needs to be a described type, and the default is used
> instead.
> 
> Replace
> 
>   ['amqp:delete-on-close:list', []]
> 
> with
> 
>   Described('amqp:delete-on-close:list', [])
> 
> (The Described type is imported from the base proton module)
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
> 


-- 
 \   / |			           |
 (OvO) |  Михаил Иванов                    |
 (^^^) |      Тел.:    +7(911) 223-1300    |
  \^/  |      E-mail:  ivans@isle.spb.ru   |
  ^ ^  |                                   |

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: delete-on-close problem in python

Posted by Gordon Sim <gs...@redhat.com>.
On 14/05/2020 10:29 am, Michael Ivanov wrote:
> Hallo,
> 
> I observe strange thing when using temporary queues in client.py script.
> I assign delete-on-close policy to temporary queue as follows:
> 
>     options=DynamicNodeProperties({"lifetime-policy" : ['amqp:delete-on-close:list', []], "exclusive" : True })
> 
> But when I check the trace I see that delete-on-close is replaced by delete-on-no-link:
> 
>     [0x1759b60]:0 <- @attach(18) [name="67234240-c66b-4936-9498-e0e66013b355-6d4569a2-f9f7-43c1-b87a-6f99976e81d9", handle=1,
> role=false, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40)
> [address="67234240-c66b-4936-9498-e0e66013b355_67234240-c66b-4936-9498-e0e66013b355-6d4569a2-f9f7-43c1-b87a-6f99976e81d9",
> durable=0, timeout=0, dynamic=false, dynamic-node-properties={:"supported-dist-modes"="move",
> :"lifetime-policy"=@:"amqp:delete-on-no-links:list" [], :exclusive=true}, distribution-mode=:move], target=@target(41)
> [durable=0, timeout=0, dynamic=false], initial-delivery-count=0, max-message-size=0]
> 
> When I assign same property in c++ code it is shown in trace correctly:
> 
>     [0xb37260]:0 <- @attach(18) [name="receiver-10599.0", handle=0, role=false, snd-settle-mode=2, rcv-settle-mode=0,
> source=@source(40) [address="EB39BD71-C919-4936-A7C9-65334513620D_receiver-10599.0", durable=0, timeout=0, dynamic=false,
> dynamic-node-properties={:"supported-dist-modes"="move", :"lifetime-policy"=@:"amqp:delete-on-close:list" [], :exclusive=true},
> distribution-mode=:move], target=@target(41) [durable=0, timeout=0, dynamic=false], initial-delivery-count=0, max-message-size=0]
> 
> I grepped through proton 0.28 code for 'delete-' tokens but did not find anything
> that looked like delete-on-close replacement.
> 
> Can you help me to find where the replacement occurs in python?

It is not being replaced, but your attempt to set it is failing as it 
needs to be a described type, and the default is used instead.

Replace

   ['amqp:delete-on-close:list', []]

with

   Described('amqp:delete-on-close:list', [])

(The Described type is imported from the base proton module)


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org