Comments (5)
Hi,
Do you get the same issue if you pass in an empy map instead of nil?
from gremgo.
Yes, I'm having issues getting any response. See example:
for i := 0; i < 100; i++ {
res, err := g.Execute(// Sends a query to Gremlin Server with bindings
fmt.Sprintf("g.addV('label%v').property('testkey','testvalue')", i),
map[string]string{},
)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(res) //Always prints [], even though can verify vertex got added via gremlin console with a label0, label1, label2, etc...
}
for i := 0; i < 2000; i++ {
res, err := g.Execute(// Sends a query to Gremlin Server with bindings
"g.V(x)",
map[string]string{"x": fmt.Sprintf("%v", i)},
)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(res) //Always prints[], not sure if bindings are working
}
for i := 0; i < 2000; i++ {
res, err := g.Execute(// Sends a query to Gremlin Server with bindings
fmt.Sprintf("g.V(%v)", i),
map[string]string{},
)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(res) //Always prints[], even though via gremlin console can verify g.V(0) exists
}
Additionally, I periodically got an error, so I added this line to gremgo/client.go:
func (c *Client) executeRequest(query string, bindings map[string]string) (resp interface{}, err error) {
req, id := prepareRequest(query, bindings)
msg, err := packageRequest(req)
if err != nil {
fmt.Println(err) // <-------------------------Added here
return // TODO: Fix error handling
}
c.dispatchRequest(msg)
resp = c.retrieveResponse(id)
return
}
and when running that above code, randomly see this exception occur at different times.
goroutine 1 [running]:
runtime.throw(0x4b8280, 0x21)
/usr/local/Cellar/go/1.6/libexec/src/runtime/panic.go:530 +0x90 fp=0xc82004bad8 sp=0xc82004bac0
runtime.mapaccess1_faststr(0x32cb60, 0xc820073170, 0xc8203fe210, 0x24, 0x0)
/usr/local/Cellar/go/1.6/libexec/src/runtime/hashmap_fast.go:202 +0x5b fp=0xc82004bb38 sp=0xc82004bad8
github.com/qasaur/gremgo.(_Client).executeRequest(0xc820073110, 0x451948, 0x6, 0xc8203fe1e0, 0x0, 0x0, 0x0, 0x0)
/Users/dev/gowork/src/github.com/qasaur/gremgo/client.go:59 +0x2ef fp=0xc82004bcb8 sp=0xc82004bb38
github.com/qasaur/gremgo.(_Client).Execute(0xc820073110, 0x451948, 0x6, 0xc8203fe1e0, 0x0, 0x0, 0x0, 0x0)
/Users/dev/gowork/src/github.com/qasaur/gremgo/client.go:65 +0x5e fp=0xc82004bd00 sp=0xc82004bcb8
main.initGremlin()
from gremgo.
Thank you for bringing this up. I investigated the code further and discovered some issues and a critical race condition with the read worker and the read handler which caused the errors. I have fixed the bug in the latest commit on the master branch. It should be working properly now, but I'll wait until it has been resolved on your end before closing this issue.
Thanks,
Marcus
from gremgo.
Looks good now, thanks!!!
from gremgo.
Good to hear. Closing this issue seeing as the bug was resolved.
from gremgo.
Related Issues (20)
- broken code in request.go HOT 1
- Hook for connection failures HOT 1
- Client hangs on backend error
- How does this compare to go-gremlin/gremlin? HOT 2
- How to use session?
- Error due API change on "github.com/satori/go.uuid"
- Documentation clean-up HOT 1
- Bad uuid.NewV4 call HOT 1
- [SCRIPT EVALUATION ERROR] on setting UUID HOT 1
- Request: return struct instead of interface{} HOT 2
- go get github.com/qasaur/gremgo returns an error HOT 3
- Where is NewSecureDialer? HOT 2
- Hang on server failure
- isConnected is not an public HOT 1
- Want to be an contributor HOT 2
- websocket message length too small
- Unable to do a bulk request on database, number of documents returned is too low?
- Replace satori/go.uuid HOT 1
- Purpose of rebindings in Execute method HOT 1
- readme example is not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gremgo.