{"action":"created","issue":{"url":"https://api.github.com/repos/blevesearch/bleve/issues/408","repository_url":"https://api.github.com/repos/blevesearch/bleve","labels_url":"https://api.github.com/repos/blevesearch/bleve/issues/408/labels{/name}","comments_url":"https://api.github.com/repos/blevesearch/bleve/issues/408/comments","events_url":"https://api.github.com/repos/blevesearch/bleve/issues/408/events","html_url":"https://github.com/blevesearch/bleve/issues/408","id":170530387,"number":408,"title":"Bug introduced by commit 24a2b57","user":{"login":"mmindenhall","id":1106269,"avatar_url":"https://avatars.githubusercontent.com/u/1106269?v=3","gravatar_id":"","url":"https://api.github.com/users/mmindenhall","html_url":"https://github.com/mmindenhall","followers_url":"https://api.github.com/users/mmindenhall/followers","following_url":"https://api.github.com/users/mmindenhall/following{/other_user}","gists_url":"https://api.github.com/users/mmindenhall/gists{/gist_id}","starred_url":"https://api.github.com/users/mmindenhall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmindenhall/subscriptions","organizations_url":"https://api.github.com/users/mmindenhall/orgs","repos_url":"https://api.github.com/users/mmindenhall/repos","events_url":"https://api.github.com/users/mmindenhall/events{/privacy}","received_events_url":"https://api.github.com/users/mmindenhall/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-10T22:06:52Z","updated_at":"2016-08-27T16:08:18Z","closed_at":null,"body":"Sorry I can't dig in and provide more info right now, but commit 24a2b57 introduced a bug that causes the Search function to hang and never return (it works with previous commit).  I'm using an in-memory index (gtreap), and am doing the following:\r\n\r\n1.  Creating the in-memory index with an index mapping that includes a DateTimeMapping field.\r\n1.  Batch index some documents using the mapping.\r\n1.  Create a search request with `bleve.NewDateRangeInclusiveQuery`.\r\n1.  Execute the search -- it hangs until the test times out.\r\n\r\nIf I can, I'll try to write a test later tonight to reproduce the problem."},"comment":{"url":"https://api.github.com/repos/blevesearch/bleve/issues/comments/242925701","html_url":"https://github.com/blevesearch/bleve/issues/408#issuecomment-242925701","issue_url":"https://api.github.com/repos/blevesearch/bleve/issues/408","id":242925701,"user":{"login":"mschoch","id":298143,"avatar_url":"https://avatars.githubusercontent.com/u/298143?v=3","gravatar_id":"","url":"https://api.github.com/users/mschoch","html_url":"https://github.com/mschoch","followers_url":"https://api.github.com/users/mschoch/followers","following_url":"https://api.github.com/users/mschoch/following{/other_user}","gists_url":"https://api.github.com/users/mschoch/gists{/gist_id}","starred_url":"https://api.github.com/users/mschoch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mschoch/subscriptions","organizations_url":"https://api.github.com/users/mschoch/orgs","repos_url":"https://api.github.com/users/mschoch/repos","events_url":"https://api.github.com/users/mschoch/events{/privacy}","received_events_url":"https://api.github.com/users/mschoch/received_events","type":"User","site_admin":false},"created_at":"2016-08-27T16:08:18Z","updated_at":"2016-08-27T16:08:18Z","body":"I've been trying to reproduce this bug, but so far have been unsuccessful.  Here is my test case, it indexes 10000 docs with a date which some some random offset from the current time.  Then we create 10 query workers, and feed them 10000 queries, which search from random endpoints offset from the current time.  It takes over 3 minutes on my machine, but does not hang.\r\n\r\n```\r\nfunc TestBug408(t *testing.T) {\r\n\r\n\tm := NewIndexMapping()\r\n\tm.DefaultMapping = NewDocumentStaticMapping()\r\n\tm.DefaultMapping.AddFieldMappingsAt(\"created\", NewDateTimeFieldMapping())\r\n\r\n\tindex, err := New(\"\", m)\r\n\tif err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n\r\n\tsdate := time.Now()\r\n\t// index docs with dates some random offset from now\r\n\tfor i := 0; i < 10000; i++ {\r\n\t\tdoc := map[string]interface{}{}\r\n\t\toffset := rand.Int63()\r\n\t\tcreated := sdate.Add(time.Duration(offset))\r\n\t\tdoc[\"created\"] = created\r\n\t\terr := index.Index(fmt.Sprintf(\"%d\", i), doc)\r\n\t\tif err != nil {\r\n\t\t\tlog.Fatal(err)\r\n\t\t}\r\n\t}\r\n\r\n\trequests := make(chan *SearchRequest, 10000)\r\n\r\n\t// create 10 query workers\r\n\tvar wg sync.WaitGroup\r\n\tfor i := 0; i < 10; i++ {\r\n\t\twg.Add(1)\r\n\t\tgo func() {\r\n\t\tOUTER:\r\n\t\t\tfor {\r\n\t\t\t\tselect {\r\n\t\t\t\tcase r, ok := <-requests:\r\n\t\t\t\t\tif !ok {\r\n\t\t\t\t\t\t// close channel becomes nil channel\r\n\t\t\t\t\t\trequests = nil\r\n\t\t\t\t\t}\r\n\t\t\t\t\t_, err = index.Search(r)\r\n\t\t\t\t\tif err != nil {\r\n\t\t\t\t\t\tlog.Fatal(err)\r\n\t\t\t\t\t}\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak OUTER\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\twg.Done()\r\n\t\t}()\r\n\t}\r\n\r\n\t// build requests and put on buffered channel\r\n\tfor i := 0; i < 10000; i++ {\r\n\t\tstartOffset := -rand.Int63()\r\n\t\tendOffset := rand.Int63()\r\n\t\tstart := sdate.Add(time.Duration(startOffset))\r\n\t\tend := sdate.Add(time.Duration(endOffset))\r\n\t\tstartString := start.Format(\"2006-01-02\")\r\n\t\tendString := end.Format(\"2006-01-02\")\r\n\t\tinclude := true\r\n\t\tq := NewDateRangeInclusiveQuery(&startString, &endString, &include, &include)\r\n\t\treq := NewSearchRequest(q)\r\n\t\trequests <- req\r\n\t}\r\n\r\n\twg.Wait()\r\n}\r\n```"}}
{"actor":{"display_login":"mschoch"}}