[rabbitmq-discuss] 答复: Can't process_flag(trap_exit, true) in process
Alexandru Scvorţov
alexandru at rabbitmq.com
Fri Feb 10 10:36:47 GMT 2012
Hi David,
> the process 1 follow:
...
> the process 2 follow:
...
Ok. That code looks fine. So, when you run that, process 2 receives a
basic.cancel? And if you remove the process_flag(...) in process 1, it
doesn't? That sounds very strange and shouldn't happen.
When you say "receives a basic.cancel", do you mean that process 2 exits
with an non-normal message? Could you post the exact message if so?
Is there anything like an error in the RabbitMQ or SASL logs?
Also, what version of the server and client are you using?
Cheers,
Alex
On Fri, Feb 10, 2012 at 09:59:23AM +0000, Liuzhuofu wrote:
> Hi Alex:
>
> the process 1 follow:
> process_flag(trap_exit, true),
> ....
> ...
> {ok, Tag, Pid} = tcloud_mq_amqp_func:tc_subdesc_queue(ReadChannel, Que, MFA), %% subscribe the queue with process 2 start with MFA
> %% and after this code, the process 1 do nothing but wait for call/cast process 1 is a gen_server.
> %% process 1 never do unbind/delete opertion to the queue or any other thing
>
>
> the process 2 follow:
> loop() -> %% loop/0 is the F of MFA that start the process 2
> receive
> Msg ->
> io:format("Msg:~p~n", [Msg]),
> loop()
> end
>
> Regard
> David
>
>
> ________________________________________
> 发件人: Alexandru Scvorţov [scvalex at gmail.com] 代表 Alexandru Scvorţov [alexandru at rabbitmq.com]
> 发送时间: 2012年2月10日 17:38
> 到: Liuzhuofu
> Cc: rabbitmq-discuss at lists.rabbitmq.com
> 主题: Re: [rabbitmq-discuss] Can't process_flag(trap_exit, true) in process
>
> Hi David,
>
> > I create a connection and channel in process 1, and subscribe a queue with process 2, which created by "spawn_link" in process 1, if I run "process_flag(trap_exit, true)" in process 1, the process 2 will receive a 'basic.cancel' message for the subscribe queue. If I don't run "process_flag(trap_exit, true)" in process 1, the process 2 will never receive that.
>
> I don't follow. Are you saying that running "process_flag(trap_exit,
> true)" in process 1, the queue will get deleted immediately (and hence
> process 2 will receive a basic.cancel)?
>
> Could you post your code please?
>
> Cheers,
> Alex
>
> On Fri, Feb 10, 2012 at 08:22:10AM +0000, Liuzhuofu wrote:
> > Hi all:
> > I found a strange thing:
> > I create a connection and channel in process 1, and subscribe a queue with process 2, which created by "spawn_link" in process 1, if I run "process_flag(trap_exit, true)" in process 1, the process 2 will receive a 'basic.cancel' message for the subscribe queue. If I don't run "process_flag(trap_exit, true)" in process 1, the process 2 will never receive that.
> > Why ?
> >
> > Regards,
> > David
>
> > _______________________________________________
> > rabbitmq-discuss mailing list
> > rabbitmq-discuss at lists.rabbitmq.com
> > https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
More information about the rabbitmq-discuss
mailing list