[erlang-bugs] the error_logger does not clean up its file_io_server instances anymore (gen_event related?)

Nico Kruber nico.kruber@REDACTED
Wed Sep 16 17:11:38 CEST 2015


In the current master (ddd1acec5100f5bcc96b29f09b80edd717746edf) the following 
code does not seem to properly remove the file_io_server processes. In 
error_logger_file_h [1] however, the terminate/2 function seems to clean up by 
closing the file.

So I guess, either file:close/1 does not clean up or 
gen_event:delete_handler/3 (called by error_logger:logfile(close)[2]) does not 
call Module:terminate/2 anymore(?)


error_logger:logfile({open, "test1"}).
error_logger:logfile(close).          
error_logger:logfile({open, "test2"}).
error_logger:logfile(close).          
[{X, file:pid2name(X)} || X <- processes(),
  Data <- [process_info(X, [current_function, initial_call, 
registered_name])],
  Data =/= undefined,
  element(1, element(2, lists:keyfind(current_function, 1, Data))) =:= 
file_io_server].


[1] 
https://github.com/erlang/otp/blob/ddd1acec5100f5bcc96b29f09b80edd717746edf/lib/stdlib/src/error_logger_file_h.erl#L97
[2] 
https://github.com/erlang/otp/blob/ddd1acec5100f5bcc96b29f09b80edd717746edf/lib/kernel/src/error_logger.erl#L316
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part.
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20150916/b9e9e9e5/attachment.bin>


More information about the erlang-bugs mailing list