[erlang-questions] Reading from private ets tables?

Ulf Wiger ulf.wiger@REDACTED
Tue Oct 18 11:52:26 CEST 2011


No, you can't read private ets tables (owned by some other process).

However, in this particular case, mnesia does offer some functions that might be of help.

mnesia:info() prints quite a lot of information, including info about held locks.

Another function: mnesia_locker:get_held_locks():

3> mnesia_locker:get_held_locks().
[]
4> mnesia:create_table(t, []).
{atomic,ok}
5> spawn(fun() -> mnesia:transaction(fun() -> mnesia:write({t,1,a}), timer:sleep(30000) end) end).
<0.55.0>
6> mnesia_locker:get_held_locks().
[{{t,1},write,{tid,4,<0.55.0>}}]
...
7> mnesia_locker:get_held_locks().
[]

Finally, mnesia_lib:dist_coredump() is a big hammer, when all else fails.

BR,
Ulf W

On 18 Oct 2011, at 11:39, Attila Rajmund Nohl wrote:

> Hello!
> 
> Is there a way to read data from private ets tables? I have to debug
> mnesia, but the interesting tables (e.g. mnesia_held_locks) are
> private, so I can't find whose locks are deadlocking.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

Ulf Wiger, CTO, Erlang Solutions, Ltd.
http://erlang-solutions.com






More information about the erlang-questions mailing list