Skip to content
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

core/corehttp/gateway_handler: pass a request ctx instead of the node #6244

Merged
merged 1 commit into from
Apr 23, 2019

Conversation

reinerRubin
Copy link
Contributor

Hello,
I have tried to solve this bug [1].

idk, about "tctx" in the "deleteHandler". After tctx is defined some calls after still use original ctx. I have assumed that it is bug and changed to "tctx"

1 - #4607

Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(change of plans)

@@ -542,7 +537,7 @@ func (i *gatewayHandler) deleteHandler(w http.ResponseWriter, r *http.Request) {

var newnode *dag.ProtoNode = pbnd
for j := len(pathNodes) - 2; j >= 0; j-- {
if err := i.node.DAG.Add(ctx, newnode); err != nil {
if err := i.node.DAG.Add(tctx, newnode); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this wasn't a bug. The minute timeout is for fetching the node as that may involve a network operation. Here, we don't really want to time out at all (although the global hour timeout is fine).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, got it. I'll make usage of "tctx" more explicit. Just put it into a new method or a "block".

… ctx

License: MIT
Signed-off-by: Georgij Tolstov <tolstov.georgij@gmail.com>
@Stebalien Stebalien merged commit fc4dbb6 into ipfs:master Apr 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants