couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bob Dionne (JIRA)" <>
Subject [jira] Commented: (COUCHDB-1004) list_to_existing_atom is too restrictive as used by couch_rep
Date Sun, 02 Jan 2011 17:31:21 GMT


Bob Dionne commented on COUCHDB-1004:

Actually I'm not sure we'd want this, if in fact there's no problem with list_to_existing_atom
(see email from Klaus about COUCHDB-829)

I looked at the existing couch_util:to_existing_atom  as well as all the places it's used.
The existing function returns the string if it doesn't match an existing atom. That seems
ok in most of the uses, but .eg. in couch_rep_writer it's not clear that it works correctly

~/emacs/couchdb:master$ grep couch_util:to_existing_atom src/*/*.erl
src/couchdb/couch_httpd.erl:        Meth -> couch_util:to_existing_atom(Meth)
src/couchdb/couch_httpd.erl:        'POST' -> couch_util:to_existing_atom(MethodOverride);
src/couchdb/couch_httpd.erl:        couch_util:to_existing_atom(MochiReq:get(method)),
src/couchdb/couch_os_process.erl:        throw({error, {couch_util:to_existing_atom(Id),Reason}});
src/couchdb/couch_os_process.erl:        throw({couch_util:to_existing_atom(Id),Reason});
src/couchdb/couch_rep_writer.erl:        ErrId = couch_util:to_existing_atom(Error),
src/couchdb/couch_rep_writer.erl:    ErrId = couch_util:to_existing_atom(couch_util:get_value(<<"error">>,
src/couchdb/couch_uuids.erl:    case couch_util:to_existing_atom(AlgoStr) of

> list_to_existing_atom is too restrictive as used by couch_rep
> -------------------------------------------------------------
>                 Key: COUCHDB-1004
>                 URL:
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Replication
>         Environment: erlang
>            Reporter: Bob Dionne
>            Priority: Minor
> We'd like to additional information to db_info in BigCouch, such as the Q and N constants
for a given database. This causes replication to fail when replicating from BigCouch to CouchDB
due to the use of list_to_existing_atom in couch_rep:dbinfo(...
> The claim is that list_to_atom pollutes the atoms table, however superficial testing
indicates this is not the case, list_to_atom when called repeatedly seems to work fine. If
this is true then consider reverting list_to_existing_atom back to list_to_atom.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message