Skip to content

Race around mnesia:create_schema, mnesia:create_table #1

@squaremo

Description

@squaremo

On my mac, RabbitMQ with rabbithub as a plugin often (nearly always, in fact) fails to start.
It aborts in rabbithub_app:setup_schema while calling mnesia:create_table, and gives {badtype, rabbithub_lease, disc_copies, rabbit@localhost} as the reason.

It's easy to elicit this from mnesia:
$ erl

1> mnesia:start().
ok
2> mnesia:create_table(foo, [{attributes, [bar, baz]}, {disc_copies, [node()]}]).
{aborted,{bad_type,foo,disc_copies,nonode@nohost}}

This doesn't happen if you've called mnesia:create_schema/1 before starting mnesia. But wait -- that's exactly what setup_schema does!

I suspect there's a race between RabbitMQ calling mnesia:create_schema/1 and mnesia:start/0, and rabbithub doing so then trying to create the table.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions