forked from schwartzmx/gremtune
-
Notifications
You must be signed in to change notification settings - Fork 6
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
ExecuteAsync Swallowing Errors #127
Comments
We got the same problem. I tried the internal client without pooling and ws, wsErr := gremcos.NewWebsocket(cfg.GraphURL, gremcos.SetWritingWait(time.Second*5), gremcos.SetReadingWait(time.Second*5), gremcos.SetBufferSize(1048576, 1048576))
if wsErr != nil {
logger.Fatalf("failed to create ws: %v", wsErr)
}
errCh := make(chan error, 1000)
cosmos, cosmosErr := gremcos.Dial(ws, errCh, gremcos.SetAuth(gremcos.StaticCredentialProvider{
UsernameStatic: cfg.GraphUsername,
PasswordStatic: cfg.GraphPassword,
}))
if cosmosErr != nil {
logger.Fatalf("failed to create Cosmos client: %v", cosmosErr)
}
for {
if async {
c := make(chan interfaces.AsyncResponse, 100)
go func() {
r := <-c
concurrentIssue := false
if r.ErrorMessage != "" {
if !strings.Contains(r.ErrorMessage, "PreconditionFailedException") &&
!strings.Contains(r.ErrorMessage, "Conflict") {
logger.Panic(r.ErrorMessage)
}
}
logger.Infof("inserted to gremlin: %s %d %v", r.Response.RequestID, r.Response.Status.Code, concurrentIssue)
}()
if err := cosmos.ExecuteAsync(query, c); err != nil {
logger.Panic(err)
}
logger.Info("inserting")
time.Sleep(100 * time.Millisecond) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm working on using ExecuteAsync and I see in the logs that I'm getting an error, in my case a 409 conflict error, but its not coming back in any of the responses. I may be using it wrong but i think it should be telling me there is an error.
I'm running on 1.38.
In an example case the code below returns on the last line with an empty response array even though there are one or more errors on the back end that are visible in the logs.
It seems that 'gotResponse' is false and there are no responses on the response channel at all but also no errors?
The text was updated successfully, but these errors were encountered: