[jira] [Assigned] (COUCHDB-1445) CouchDB deletes .view files if it can't open them, even if the error is "emfile".

2012-03-18 Thread Randall Leeds (Assigned) (JIRA)

 [ 
https://issues.apache.org/jira/browse/COUCHDB-1445?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Randall Leeds reassigned COUCHDB-1445:
--

Assignee: Randall Leeds

> CouchDB deletes .view files if it can't open them, even if the error is 
> "emfile".
> -
>
> Key: COUCHDB-1445
> URL: https://issues.apache.org/jira/browse/COUCHDB-1445
> Project: CouchDB
>  Issue Type: Bug
>  Components: JavaScript View Server
>Affects Versions: 1.2
>Reporter: Jan Lehnardt
>Assignee: Randall Leeds
> Fix For: 1.2
>
>
> Via Stefan Kögl on dev@:
> Another thing I noticed during my tests of CouchDB 1.2.x. I redirected
> live traffic to the instance and after a rather short time, requests
> were failing with the following information in the logs:
> [Sun, 18 Mar 2012 16:39:24 GMT] [error] [<0.27554.2>]
> {error_report,<0.31.0>,
>{<0.27554.2>,std_error,
> [{application,mochiweb},
>  "Accept failed error",
>  "{error,emfile}"]}}
> [Sun, 18 Mar 2012 16:39:24 GMT] [error] [<0.27554.2>]
> {error_report,<0.31.0>,
>  {<0.27554.2>,crash_report,
>   [[{initial_call,
> {mochiweb_acceptor,init,
> ['Argument__1','Argument__2',
>  'Argument__3']}},
> {pid,<0.27554.2>},
> {registered_name,[]},
> {error_info,
> {exit,
> {error,accept_failed},
> [{mochiweb_acceptor,init,3},
>  {proc_lib,init_p_do_apply,3}]}},
> {ancestors,
> [couch_httpd,couch_secondary_services,
>  couch_server_sup,<0.32.0>]},
> {messages,[]},
> {links,[<0.129.0>]},
> {dictionary,[]},
> {trap_exit,false},
> {status,running},
> {heap_size,233},
> {stack_size,24},
> {reductions,244}],
>[]]}}
> I think "emfile" means that CouchDB (or mochiweb?) couldn't open any
> more files / connections. I've set the (hard and soft) nofile limit for
> user couchdb to 4096, but didn't raise the ERL_MAX_PORTS accordingly.
> Anyway, as soon as the error occured, CouchDB started writing most of my
> view files from scratch, rendering the instance unusable.
> I'd expect CouchDB to fail more gracefully when the maximum number of
> open files is reached. Is this a bug or expected behaviour?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Assigned] (COUCHDB-731) Improved Query Server tests

2012-01-15 Thread Randall Leeds (Assigned) (JIRA)

 [ 
https://issues.apache.org/jira/browse/COUCHDB-731?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Randall Leeds reassigned COUCHDB-731:
-

Assignee: Randall Leeds

> Improved Query Server tests
> ---
>
> Key: COUCHDB-731
> URL: https://issues.apache.org/jira/browse/COUCHDB-731
> Project: CouchDB
>  Issue Type: Improvement
>  Components: Test Suite
>Reporter: Matt Lyon
>Assignee: Randall Leeds
>Priority: Trivial
>
> In the process of writing a ruby version of the query server, I wrote a few 
> more tests for the javascript and erlang ones to help determine the proper 
> behavior of certain cases. The ones pertaining to handling syntax errors will 
> fail for erlang, but pass on javascript; apparently this is by design. 
> Anyway, here they are, my hope is that other people attempting an 
> implementation of the query server find them useful.
> diff --git a/test/view_server/query_server_spec.rb 
> b/test/view_server/query_server_spec.rb
> index 1de8e5b..c427e35 100644
> --- a/test/view_server/query_server_spec.rb
> +++ b/test/view_server/query_server_spec.rb
> @@ -508,34 +623,70 @@ describe "query server normal case" do
>[{:title => "Best ever", :body => "Doc body"}, {}]).should ==
>  ["resp", {"body" => "Best ever - Doc body"}] 
>end
> -  
> -  it "should run map funs" do
> -@qs.reset!
> -@qs.run(["add_fun", functions["emit-twice"][LANGUAGE]]).should == true
> +  it "should clear map functions on reset" do
>  @qs.run(["add_fun", functions["emit-once"][LANGUAGE]]).should == true
> -rows = @qs.run(["map_doc", {:a => "b"}])
> -rows[0][0].should == ["foo", "b"]
> -rows[0][1].should == ["bar", "b"]
> -rows[1][0].should == ["baz", "b"]
> +@qs.run(["map_doc", {:a => "b"}]).size.should be > 0
> +@qs.run(["reset"])
> +@qs.run(["map_doc", {:a => "b"}]).size.should == 0
>end
> +  
> +  describe "map functions" do
> +before do
> +  @qs.reset!
> +end
> +it "should run map funs" do
> +  @qs.run(["add_fun", functions["emit-twice"][LANGUAGE]]).should == true
> +  @qs.run(["add_fun", functions["emit-once"][LANGUAGE]]).should == true
> +  rows = @qs.run(["map_doc", {:a => "b"}])
> +  rows[0][0].should == ["foo", "b"]
> +  rows[0][1].should == ["bar", "b"]
> +  rows[1][0].should == ["baz", "b"]
> +end
> +
> +it "should return error on invalid expressions" do
> +  response = @qs.run(["add_fun", 
> functions["map-invalid-expression"][LANGUAGE]])
> +  response.should be_kind_of Array
> +  response[0].should == 'error'
> +  response[1].should == 'compilation_error'
> +end
> +
> +it "should return error on non-function expressions" do
> +  response = @qs.run(["add_fun", 
> functions["map-non-function-expression"][LANGUAGE]])
> +  response.should be_kind_of Array
> +  response[0].should == 'error'
> +  response[1].should == 'compilation_error'
> +end
> +
> +it "has access to the logger" do
> +  @qs.run(["add_fun", functions["map-logging"][LANGUAGE]])
> +  @qs.rrun(["map_doc", {:a => "b"}])
> +  response = JSON.parse @qs.rgets
> +  response.should == ["log", "{\"a\":\"b\"}"]
> +  response = @qs.jsgets
> +  response.should == [[[ "logged", "b" ]]]
> +end
> +  end
> +
>describe "reduce" do
>  before(:all) do
>@fun = functions["reduce-values-length"][LANGUAGE]
> +  @fun2 = functions["reduce-values-sum"][LANGUAGE]
>@qs.reset!
>  end
>  it "should reduce" do
>kvs = (0...10).collect{|i|[i,i*2]}
> -  @qs.run(["reduce", [@fun], kvs]).should == [true, [10]]
> +  @qs.run(["reduce", [@fun, @fun2], kvs]).should == [true, [10, 90]]
>  end
>end
>describe "rereduce" do
>  before(:all) do
>@fun = functions["reduce-values-sum"][LANGUAGE]
> +  @fun2 = functions["reduce-values-length"][LANGUAGE]
>@qs.reset!
>  end
>  it "should rereduce" do
>vs = (0...10).collect{|i|i}
> -  @qs.run(["rereduce", [@fun], vs]).should == [true, [45]]
> +  @qs.run(["rereduce", [@fun, @fun2], vs]).should == [true, [45, 10]]
>  end
>end
>  
> @@ -648,6 +799,15 @@ describe "query server normal case" do
>doc.should == {"foo" => "gnarly", "world" => "hello"}
>resp["body"].should == "hello doc"
>  end
> +# TODO: fails in erlang, passes in javascript. does it matter or not?
> +it "should reject GET requests" do
> +  err, name, msg = @qs.ddoc_run(@ddoc,
> +["updates","basic"],
> +[{"foo" => "gnarly"}, {"method" => "GET"}]
> +  )
> +  err.should == "error"
> +  name.should == "method_not_allowed"
> +end
>end
>  
>  # end
> @@ -655,99 +815,100 @@ describe "query server normal case" do
>  # __END__
>  
>describe "ddoc l

[jira] [Assigned] (COUCHDB-921) Futon aggressively warns of no data returned on click away from view page

2012-01-15 Thread Randall Leeds (Assigned) (JIRA)

 [ 
https://issues.apache.org/jira/browse/COUCHDB-921?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Randall Leeds reassigned COUCHDB-921:
-

Assignee: Randall Leeds

> Futon aggressively warns of no data returned on click away from view page
> -
>
> Key: COUCHDB-921
> URL: https://issues.apache.org/jira/browse/COUCHDB-921
> Project: CouchDB
>  Issue Type: Bug
>  Components: Futon
>Affects Versions: 1.0.1
>Reporter: Jeff Zellner
>Assignee: Randall Leeds
>Priority: Minor
>
> When waiting for view data to appear in Futon (while view groups are being 
> indexed for example) -- leaving the page via clicking a link causes Futon to 
> show a Javascript alert that requires dismissal:
> "Error: An error occurred accessing the view
> no response"
> This is overly aggressive reporting and should probably only appears in the 
> case of an actual timeout -- not simply leaving the page via click.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Assigned] (COUCHDB-1339) JS CLI Test Suite: use shell trap to catch dying beam processes during test runs

2012-01-05 Thread Randall Leeds (Assigned) (JIRA)

 [ 
https://issues.apache.org/jira/browse/COUCHDB-1339?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Randall Leeds reassigned COUCHDB-1339:
--

Assignee: Randall Leeds

> JS CLI Test Suite: use shell trap to catch dying beam processes during test 
> runs
> 
>
> Key: COUCHDB-1339
> URL: https://issues.apache.org/jira/browse/COUCHDB-1339
> Project: CouchDB
>  Issue Type: Improvement
>  Components: Test Suite
>Affects Versions: 1.3
>Reporter: Jan Lehnardt
>Assignee: Randall Leeds
>Priority: Blocker
> Fix For: 1.3
>
>
> The JS CLI test suite that now runs with make check (post 1.2.x master only) 
> starts CouchDB using make dev && utils/run -b and stops it with utils/run -d. 
> One issue with this is that the CouchDB process might terminate in the 
> background. The shell trap command allows the test suite to act on that 
> accordingly, otherwise the test suite would just freeze.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Assigned] (COUCHDB-1338) JS CLI test suite: have CouchDB start with port=0

2012-01-05 Thread Randall Leeds (Assigned) (JIRA)

 [ 
https://issues.apache.org/jira/browse/COUCHDB-1338?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Randall Leeds reassigned COUCHDB-1338:
--

Assignee: Randall Leeds

> JS CLI test suite: have CouchDB start with port=0 
> --
>
> Key: COUCHDB-1338
> URL: https://issues.apache.org/jira/browse/COUCHDB-1338
> Project: CouchDB
>  Issue Type: Improvement
>  Components: Test Suite
>Affects Versions: 1.3
>Reporter: Jan Lehnardt
>Assignee: Randall Leeds
>Priority: Blocker
> Fix For: 1.3
>
>
> The JS CLI test suite that now runs with make check (post 1.2.x master only) 
> starts CouchDB using make dev && utils/run -b and stops it with utils/run -d.
> One issue with this is that one might have CouchDB already running on the 
> default port 5984. The suggestion here is to start CouchDB with an additional 
> .ini file that sets the port number to 0 to let the TCP stack figure out a 
> free port for us. The tests then need to be updated to discover the automatic 
> port using the couch.uri file.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Assigned] (COUCHDB-1363) Race condition edge case when pulling local changes

2011-12-14 Thread Randall Leeds (Assigned) (JIRA)

 [ 
https://issues.apache.org/jira/browse/COUCHDB-1363?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Randall Leeds reassigned COUCHDB-1363:
--

Assignee: Filipe Manana

> Race condition edge case when pulling local changes
> ---
>
> Key: COUCHDB-1363
> URL: https://issues.apache.org/jira/browse/COUCHDB-1363
> Project: CouchDB
>  Issue Type: Bug
>  Components: Database Core
>Affects Versions: 1.0.3, 1.1.1
>Reporter: Randall Leeds
>Assignee: Filipe Manana
>Priority: Minor
> Fix For: 1.2, 1.3
>
> Attachments: 0001-Fix-a-race-condition-starting-replications.patch
>
>
> It's necessary to re-open the #db after subscribing to notifications so that 
> updates are not lost. In practice, this is rarely problematic because the 
> next change will cause everything to catch up, but if a quick burst of 
> changes happens while replication is starting the replication can go stale. 
> Detected by intermittent replicator_db js test failures.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Assigned] (COUCHDB-1166) See if the U+2028 character breaks JSONP

2011-12-12 Thread Randall Leeds (Assigned) (JIRA)

 [ 
https://issues.apache.org/jira/browse/COUCHDB-1166?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Randall Leeds reassigned COUCHDB-1166:
--

Assignee: Paul Joseph Davis

Assigning to davisp after his last comment.

> See if the U+2028 character breaks JSONP
> 
>
> Key: COUCHDB-1166
> URL: https://issues.apache.org/jira/browse/COUCHDB-1166
> Project: CouchDB
>  Issue Type: Improvement
>Reporter: Jan Lehnardt
>Assignee: Paul Joseph Davis
>Priority: Minor
>
> We should see if we need to fix our JSON responses over JSONP according to 
> http://timelessrepo.com/json-isnt-a-javascript-subset

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Assigned] (COUCHDB-860) Futon appends wrong version number to files

2011-10-20 Thread Randall Leeds (Assigned) (JIRA)

 [ 
https://issues.apache.org/jira/browse/COUCHDB-860?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Randall Leeds reassigned COUCHDB-860:
-

Assignee: Randall Leeds

> Futon appends wrong version number to files
> ---
>
> Key: COUCHDB-860
> URL: https://issues.apache.org/jira/browse/COUCHDB-860
> Project: CouchDB
>  Issue Type: Bug
>  Components: Futon
>Affects Versions: 1.0.1
>Reporter: Volker Mische
>Assignee: Randall Leeds
>Priority: Minor
> Attachments: 
> 0001-remove-version-number-from-futon-static-resources.patch, 
> 0002-Futon-Cache-Control.patch
>
>
> Futon appends the CouchDB version number to the JavaScript files it loads. In 
> 1.0.1 it still appends 0.11

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Assigned] (COUCHDB-642) Support rev in PUT URL

2011-10-06 Thread Randall Leeds (Assigned) (JIRA)

 [ 
https://issues.apache.org/jira/browse/COUCHDB-642?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Randall Leeds reassigned COUCHDB-642:
-

Assignee: Randall Leeds

> Support rev in PUT URL
> --
>
> Key: COUCHDB-642
> URL: https://issues.apache.org/jira/browse/COUCHDB-642
> Project: CouchDB
>  Issue Type: New Feature
>  Components: HTTP Interface
> Environment: trunk 08 Feb 2010
>Reporter: Brian Candler
>Assignee: Randall Leeds
>Priority: Minor
> Attachments: 0001-Allow-for-the-current-revision-number-to-be.patch
>
>
> A DELETE request lets you append ?rev= to the URL. But this doesn't work 
> with a PUT request; you have to put the _rev in the body instead (even though 
> the _id is taken from the URL path)
> $ curl -X PUT -d "{}" 
> http://brianadmin:brianadmin@127.0.0.1:5984/briantest/foo
> {"ok":true,"id":"foo","rev":"1-967a00dff5e02add41819138abb3284d"}
> $ curl -X PUT -d "{}" 
> http://brianadmin:brianadmin@127.0.0.1:5984/briantest/foo?rev=1-967a00dff5e02add41819138abb3284d
> {"error":"conflict","reason":"Document update conflict."}
> $ curl -X PUT -d '{"_rev":"1-967a00dff5e02add41819138abb3284d"}' 
> http://brianadmin:brianadmin@127.0.0.1:5984/briantest/foo
> {"ok":true,"id":"foo","rev":"2-7051cbe5c8faecd085a3fa619e6e6337"}
> Allowing ?rev in the URL would make PUT and DELETE more consistent, and would 
> allow you to replace an existing JSON doc with another one without having to 
> merge the _rev into it first.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Assigned] (COUCHDB-1298) X-Couch-Update-NewRev and "ETag" and Content-Type

2011-09-28 Thread Randall Leeds (Assigned) (JIRA)

 [ 
https://issues.apache.org/jira/browse/COUCHDB-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Randall Leeds reassigned COUCHDB-1298:
--

Assignee: Randall Leeds

> X-Couch-Update-NewRev and "ETag" and Content-Type
> -
>
> Key: COUCHDB-1298
> URL: https://issues.apache.org/jira/browse/COUCHDB-1298
> Project: CouchDB
>  Issue Type: Improvement
>  Components: Database Core
>Affects Versions: 1.2
>Reporter: gert cuykens
>Assignee: Randall Leeds
>Priority: Trivial
>  Labels: couchdb
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> There are two inconsistencies 
> 1) The use of ETag vs X-Couch-Update-NewRev
> 2) The use of "..." around the rev number
> PUT /users/_design/user/_update/form/gert HTTP/1.1
> Host: 127.0.0.1:5984
> HTTP/1.1 201 Created
> X-Couch-Update-NewRev: 245-2ddebfc32429bc723cb20543a97d3598
> Server: CouchDB/1.3.0a-f07c75f-git (Erlang OTP/R13B03)
> Date: Wed, 28 Sep 2011 15:49:49 GMT
> Content-Type: text/html; charset=utf-8
> Content-Length: 8
> PUT /users/gert/picture.png HTTP/1.1
> Host: 127.0.0.1:5984
> HTTP/1.1 201 Created
> Server: CouchDB/1.3.0a-f07c75f-git (Erlang OTP/R13B03)
> Location: http://127.0.0.1:5984/users/gert/picture.png
> ETag: "246-f1291707f1827ef38217972ea1f3824c"
> Date: Wed, 28 Sep 2011 15:50:25 GMT
> Content-Type: text/plain;charset=utf-8
> Content-Length: 69
> Cache-Control: must-revalidate
> Pleas always use ETag without "..."
> When a new document is been created, also use ETag because its already 
> indicated by status 201, no need for special headers.
> Also note Content-Type: is different, see the space between ;...charset

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira