[rabbitmq-discuss] Creating an auth plugin (Kerberos)
Simon Lundström
simlu at su.se
Wed Dec 5 13:42:04 GMT 2012
On Wed, 2012-12-05 at 14:12:21 +0100, Simon Lundström wrote:
> > One thing I would suggest is that if you do hit `after 5000` and time out whilst waiting for the external program to complete, it *might* be a good idea to close the port so as not to leak resources. Check the open_port documentation for details.
>
> Ah, I didn't read the eof documentation good enough it seems.
>
> "The port will not be closed at the end of the file and produce an exit signal."
>
> Thank you, good catch!
Hm, no matter where I put the port_close/1 call (I've tried kinit/2,
kinit/3 and loop/2) and even if I receive the {'EXIT'} message in my
loop/2 I still get:
=CRASH REPORT==== 5-Dec-2012::14:30:43 ===
crasher:
initial call: rabbit_reader:init/4
pid: <0.280.0>
registered_name: []
exception exit: {unexpected_message,{'EXIT',#Port<0.6598>,normal}}
in function rabbit_reader:handle_other/3
in call from rabbit_reader:start_connection/7
ancestors: [<0.277.0>,rabbit_tcp_client_sup,rabbit_sup,<0.149.0>]
messages: []
links: [<0.277.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 2584
stack_size: 24
reductions: 6594
neighbours:
=SUPERVISOR REPORT==== 5-Dec-2012::14:30:43 ===
Supervisor: {<0.277.0>,rabbit_connection_sup}
Context: child_terminated
Reason: {unexpected_message,{'EXIT',#Port<0.6598>,normal}}
Offender: [{pid,<0.280.0>},
{name,reader},
{mfa,{rabbit_reader,start_link,
[<0.279.0>,<0.278.0>,
#Fun<rabbit_heartbeat.2.20850803>]}},
{restart_type,intrinsic},
{shutdown,4294967295},
{child_type,worker}]
=SUPERVISOR REPORT==== 5-Dec-2012::14:30:43 ===
Supervisor: {<0.277.0>,rabbit_connection_sup}
Context: shutdown
Reason: reached_max_restart_intensity
Offender: [{pid,<0.280.0>},
{name,reader},
{mfa,{rabbit_reader,start_link,
[<0.279.0>,<0.278.0>,
#Fun<rabbit_heartbeat.2.20850803>]}},
{restart_type,intrinsic},
{shutdown,4294967295},
{child_type,worker}]
Must I use my own supervisor (which I have removed before)?
How can I check if the Port leakage actually exists? How can I see what
ports are open in my process?
Thanks,
- Simon
More information about the rabbitmq-discuss
mailing list