Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

retry connection in couchbeam_uuids #121

Closed
benoitc opened this issue Dec 8, 2014 · 3 comments
Closed

retry connection in couchbeam_uuids #121

benoitc opened this issue Dec 8, 2014 · 3 comments
Assignees

Comments

@benoitc
Copy link
Owner

benoitc commented Dec 8, 2014

When the couchbeam attempts to get a UUIDS using a closed socket it get the following error:

=ERROR REPORT==== 9-Dec-2014::00:29:35 ===
** Generic server couchbeam_uuids terminating 
** Last message in was {get_uuids,
                           {server,<<"http://localhost:5984">>,
                               [{connect_timeout,200}]},
                           1}
** When Server state == {state}
** Reason for termination == 
** {{badmatch,{error,closed}},
    [{couchbeam_uuids,do_get_uuids,4,
                      [{file,"src/couchbeam_uuids.erl"},{line,90}]},
     {couchbeam_uuids,handle_call,3,
                      [{file,"src/couchbeam_uuids.erl"},{line,61}]},
     {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,580}]},
     {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,237}]}]}
** exception exit: {{{badmatch,{error,closed}},
                     [{couchbeam_uuids,do_get_uuids,4,
                                       [{file,"src/couchbeam_uuids.erl"},{line,90}]},
                      {couchbeam_uuids,handle_call,3,
                                       [{file,"src/couchbeam_uuids.erl"},{line,61}]},
                      {gen_server,handle_msg,5,
                                  [{file,"gen_server.erl"},{line,580}]},
                      {proc_lib,init_p_do_apply,3,
                                [{file,"proc_lib.erl"},{line,237}]}]},
                    {gen_server,call,
                                [couchbeam_uuids,
                                 {get_uuids,{server,<<"http://localhost:5984">>,
                                                    [{connect_timeout,200}]},
                                            1}]}}
     in function  gen_server:call/2 (gen_server.erl, line 182)
     in call from couchbeam:save_doc/4 (src/couchbeam.erl, line 563)
     ....
@benoitc benoitc self-assigned this Dec 8, 2014
@benoitc
Copy link
Owner Author

benoitc commented Dec 8, 2014

There is no real reason to connect to couchdb to retrieve UUIDS. instead we should use our own proper module locally so we also remove one extra call.

@kxepal
Copy link

kxepal commented Dec 8, 2014

Here you the case when it could make a sense: uuids with utc_id algorithm when uuid isn't just an uuid, but just some magic id value. This magic is defined by utc_id_suffix which is server specific and you probably won't embed such into your code. But in overall yes, there are almost no reasons to call /__uuids from client side.

@benoitc
Copy link
Owner Author

benoitc commented Dec 9, 2014

@kxepal right... Also let's just fix the issue right now, if not it would need a major release.

@benoitc benoitc closed this as completed in 3d17d20 Dec 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants