benoitc / couchbeam

Apache CouchDB client in Erlang
Other
242 stars 113 forks source link

Couchbeam shuts down if one tries to create a database with the same name #11

Closed Tyra-Bjurman closed 14 years ago

Tyra-Bjurman commented 14 years ago

6> Db1 = couchbeam_db:create(Connection, "home/dev/hp"). <0.72.0> 7> Db1 = couchbeam_db:create(Connection, "home/dev/hp").

=ERROR REPORT==== 3-Nov-2009::18:27:29 === * Generic server <0.63.0> terminating * Last message in was {'EXIT',<0.37.0>, {{badmatch,precondition_failed}, [{erl_eval,expr,3}]}} * When Server state == {server_state, {couchdb_params,"127.0.0.1",5984,false,"/",nil, nil,default,infinity}, "/",default,24593,28690,<0.64.0>} * Reason for termination == * {{badmatch,precondition_failed},[{erl_eval,expr,3}]} * exception error: no match of right hand side value precondition_failed 8> =ERROR REPORT==== 3-Nov-2009::18:27:29 === * Generic server couchbeam_manager terminating * Last message in was {'DOWN',#Ref<0.0.0.282>,process,<0.72.0>, {{badmatch,precondition_failed}, [{erl_eval,expr,3}]}} * When Server state == {couchbeam_manager, {dict,1,16,16,8,80,48, {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}, {{[],[],[],[], [[default|{<0.75.0>,#Ref<0.0.0.292>}]], [],[],[],[],[],[],[],[],[],[],[]}}}, {dict,1,16,16,8,80,48, {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}, {{[],[],[],[],[],[],[],[],[],[],[],[],[], [[{default,"home/dev/hp"}| {<0.72.0>, {{default,"home/dev/hp"},"home%2fdev%2fhp"}, default,#Ref<0.0.0.282>}]], [],[]}}}, {dict,2,16,16,8,80,48, {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}, {{[],[],[],[], [[#Ref<0.0.0.257>| {connection, {couchdb_params,"127.0.0.1",5984,false,"/", nil,nil,default,infinity}}]], [],[],[],[], [[#Ref<0.0.0.282>| {db,default, {{default,"home/dev/hp"},"home%2fdev%2fhp"}}]], [],[],[],[],[],[]}}}} * Reason for termination == \ {badarg,[{erlang,monitor,[process,{unknown_error,500}]}, {couchbeam_manager,handle_info,2}, {gen_server,handle_msg,5}, {proc_lib,init_p_do_apply,3}]}

=ERROR REPORT==== 3-Nov-2009::18:27:29 === * Generic server <0.75.0> terminating * Last message in was {'EXIT',<0.61.0>, {badarg, [{erlang,monitor,[process,{unknown_error,500}]}, {couchbeam_manager,handle_info,2}, {gen_server,handle_msg,5}, {proc_lib,init_p_do_apply,3}]}} * When Server state == {server_state, {couchdb_params,"127.0.0.1",5984,false,"/",nil, nil,default,infinity}, "/",default,45073,49170,<0.76.0>} * Reason for termination == \ {badarg,[{erlang,monitor,[process,{unknown_error,500}]}, {couchbeam_manager,handle_info,2}, {gen_server,handle_msg,5}, {proc_lib,init_p_do_apply,3}]}

8> Db2 = couchbeam_db:create(Connection, "homeev/hp").
\ exception exit: {noproc,{gen_server,call, [<0.63.0>,{create_db,"homeev/hp",true},infinity]}} in function gen_server:call/3 9>

benoitc commented 14 years ago

6/7 are normal erlang error. Since Db1 have already a value at 6 you can't assign a new value to it at 7. The last error is due to the fact you are in shell. Seem like an error kill connection process. I don't reproduce it in real use, afaik the connection should be restored. I'm closing this bug right now. Fell free to open a new ticket if you see this error in "normal" app use. Anyway thanks for the feedback.

sendtopms commented 14 years ago

I am also having this problem. Couchbeam is not able to restart after the crash.

benoitc commented 14 years ago

is this in app mode ?

Tyra-Bjurman commented 14 years ago

I never tested this outside of the shell.

benoitc commented 14 years ago

that may be a reason. I will write a unittest for that later today.