[ejabberd] pubsub_item.DAT getting big

Stephan Maihöfer sma at turtle-entertainment.de
Thu Oct 2 15:37:45 MSD 2008


hi,

sorry to bother you again on this, but it really is weird. 

> i did that, reloaded the pubsub module in the web admin, i 
> still see nodes that have 5 or even 10 items attached to them.

we are having nodes with hundreds of items, which should
not be possible, even with the default setting of ?MAXITEMS
in mod_pubsub.erl. I looked at the source and from what
i can see from the node-config even max_items/1 in
mod_pubsub.erl should return 0 or at least 2, as configured
for the node. since we set persis_items to "false" and
send_last_published_item to never.

max_items(Options) ->
    case get_option(Options, persist_items) of
        true ->
            case get_option(Options, max_items) of
                false -> unlimited;
                Result when (Result < 0) -> 0;
                Result -> Result
            end;
        false ->
            case get_option(Options, send_last_published_item) of
                never -> 0;
                _ -> 1
            end
    end.

so i dont see how remove_extra_items/4 in
node_default.erl (which we call from our node_flat.erl) does
not delete the items, or how publish_item/6 does not update
it...the source looks ok from a quick glance over it, but
the mere existance of a node with hundreds of items makes
me _know_ something does not work right here.

one thing that i _could_ see is that we are setting
persist_items to 0 instead of "false", does that make
a difference?

get_option(Options, Var, Def) ->
    case lists:keysearch(Var, 1, Options) of
        {value, {_Val, Ret}} -> Ret;
        _ -> Def
    end.

looks like it does, or not? how is 0 interpreted in erlang is it
false?

thanks for the help in advance,
stephan


More information about the ejabberd mailing list