-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Adder: Make sure errors from addAllAndPin make it to the client #3230
Conversation
Before the error would be printed by the daemon but not make it to the client. License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
b66b53f
to
465e194
Compare
Not sure if this is the best way to go about fixing this. A better way would be to somehow trigger this case in PostRun:
But that doesn't seam possible. However, it could be that I just don't understand the code well enough. |
This LGTM. I wonder why the error returned there doesnt get propogated to the other side... It does so in other commands |
@whyrusleeping The problem here is that the Run() function has already returned with non-error status. res.SetError is then called in a go routine. When run without the daemon online this seams to work okay, when run with the daemon the server does not know what to do with the error so it just logs it. There does not appear to be a way to retrieve the error status when run with the daemon online; however, I might be missing something. Is there another command that does a res.SetError in a go routene? If so, let me know I and will figure out what the problem is in this case. |
@kevina I think |
@whyrusleeping, actually I found the problem. The server was sending an error response but the client code in My recommendation is to merge this and file a bug report for a correct fix, but there code doesn't need to be merged right away. |
@kevina what if that |
@whyrusleeping, that seams to work. Have a look at 2d795b5. I am just not 100% sure why it works... If you are happy with the new change I will close this pull request and create a new one with the readStreamedJson fix. BTW: There are tests case for this #2634. I am not really sure how to create a test case for this outside of #2634 as I would have to create an error somehow and make sure it doesn't get dropped. |
@kevina hrm... I guess i'm fine with waiting on the test cases for that one. Lets go ahead and close this in favor of the other change |
Better fix than ipfs#3230 to make sure errors from addAllAndPin make it to the client. License: MIT Signed-off-by: Kevin Atkinson <k@kevina.org>
Closing in favor of #3276. |
Before the error would be printed by the daemon but not make it to the
client.
License: MIT
Signed-off-by: Kevin Atkinson k@kevina.org