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

Fix infinite querying bug (reproducible on some gateway conformance tests that were disabled in https://github.com/ipfs/helia-verified-fetch/pull/81) #84

Closed
Tracked by #82
SgtPooki opened this issue May 16, 2024 · 2 comments · Fixed by #85
Assignees

Comments

@SgtPooki
Copy link
Member

SgtPooki commented May 16, 2024

To reproduce:

  1. pull down the package
  2. npm run reset && npm i && npm run build
  3. Remove the commented out test for TestNativeDag in packages/gateway-conformance/src/conformance.spec.ts
  4. cd packages/gateway-conformance && DEBUG="-mocha*,-babel*,-pw*,*,*:trace,-conformance-tests*,-kubo-rpc-client*" npm run test -- -g 'TestNativeDag'
@SgtPooki
Copy link
Member Author

Note that I tested a npm pack version of ipfs/helia#538 against gateway-conformance tests that are timing out, and it doesn't seem to infinitely loop anymore but it still times out

@SgtPooki
Copy link
Member Author

seems like isEvicted fix from Alex resolved part of the problem here:

  helia:verified-fetch fetch http://localhost:3442/ipfs/bafkreignx6d6kfdi6q3sqayf4bef7y54k7ztbhd7gci23wr6cpl2opqqoe +10ms
  helia:verified-fetch:get-resolved-accept-header no explicit IPLD content-type requested, returning incoming accept header undefined +0ms
  helia:verified-fetch output type undefined +0ms
  helia:verified-fetch:trace finding handler for cid code "85" and output type "undefined" +10ms
  helia:verified-fetch:trace calling handler "handleRaw" +0ms
  helia:verified-fetch:byte-range-context:trace no range request detected +0ms
  helia:trustless-gateway:session:bafkreignx6d6kfdi6q3sqayf4bef7y54k7ztbhd7gci23wr6cpl2opqqoe finding 1-5 new provider(s) for bafkreignx6d6kfdi6q3sqayf4bef7y54k7ztbhd7gci23wr6cpl2opqqoe +0ms
  helia:trustless-gateway:session:bafkreignx6d6kfdi6q3sqayf4bef7y54k7ztbhd7gci23wr6cpl2opqqoe found 0/5 new providers +0ms
  helia:trustless-gateway:session:bafkreignx6d6kfdi6q3sqayf4bef7y54k7ztbhd7gci23wr6cpl2opqqoe session is ready +0ms
  helia:trustless-gateway:session:bafkreignx6d6kfdi6q3sqayf4bef7y54k7ztbhd7gci23wr6cpl2opqqoe found initial session peers for bafkreignx6d6kfdi6q3sqayf4bef7y54k7ztbhd7gci23wr6cpl2opqqoe +0ms
  helia:trustless-gateway:session:bafkreignx6d6kfdi6q3sqayf4bef7y54k7ztbhd7gci23wr6cpl2opqqoe fetching BLOCK for bafkreignx6d6kfdi6q3sqayf4bef7y54k7ztbhd7gci23wr6cpl2opqqoe from http://127.0.0.1:3440/ +0ms
  helia:trustless-gateway-block-broker:127.0.0.1 GET http://127.0.0.1:3440/ipfs/bafkreignx6d6kfdi6q3sqayf4bef7y54k7ztbhd7gci23wr6cpl2opqqoe?format=raw 500 +0ms
  helia:trustless-gateway:session:bafkreignx6d6kfdi6q3sqayf4bef7y54k7ztbhd7gci23wr6cpl2opqqoe:error error querying provider TrustlessGateway { url: URL { href: 'http://127.0.0.1:3440/', origin: 'http://127.0.0.1:3440', protocol: 'http:', username: '', password: '', host: '127.0.0.1:3440', hostname: '127.0.0.1', port: '3440', pathname: '/', search: '', searchParams: URLSearchParams {}, hash: '' }, log: [Function: debug] { namespace: 'helia:trustless-gateway-block-broker:127.0.0.1', useColors: true, color: 32, extend: [Function: extend], destroy: [Function: deprecated], enabled: [Getter/Setter], inspectOpts: {}, error: [Function: debug] { namespace: 'helia:trustless-gateway-block-broker:127.0.0.1:error', useColors: true, color: 166, extend: [Function: extend], destroy: [Function: deprecated], enabled: [Getter/Setter], inspectOpts: {} }, trace: [Function: debug] { namespace: 'helia:trustless-gateway-block-broker:127.0.0.1:trace', useColors: true, color: 129, extend: [Function: extend], destroy: [Function: deprecated], enabled: [Getter/Setter], inspectOpts: {} }, diff: 0, prev: undefined, curr: 1716236294767 } }, evicting from session Error: unable to fetch raw block for CID bafkreignx6d6kfdi6q3sqayf4bef7y54k7ztbhd7gci23wr6cpl2opqqoe
    at TrustlessGateway.getRawBlock (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/helia-verified-fetch/packages/verified-fetch/node_modules/@helia/block-brokers/dist/src/trustless-gateway/trustless-gateway.js:108:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async TrustlessGatewaySession.queryProvider (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/helia-verified-fetch/packages/verified-fetch/node_modules/@helia/block-brokers/dist/src/trustless-gateway/session.js:19:23)
    at async raceSignal (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/helia-verified-fetch/node_modules/race-signal/dist/src/index.js:28:16)
    at async Job.run (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/helia-verified-fetch/node_modules/@libp2p/utils/dist/src/queue/job.js:55:28) +0ms
  helia:trustless-gateway:session:bafkreignx6d6kfdi6q3sqayf4bef7y54k7ztbhd7gci23wr6cpl2opqqoe no session peers had block for for bafkreignx6d6kfdi6q3sqayf4bef7y54k7ztbhd7gci23wr6cpl2opqqoe, finding new providers +73ms
  helia:trustless-gateway:session:bafkreignx6d6kfdi6q3sqayf4bef7y54k7ztbhd7gci23wr6cpl2opqqoe finding 1-5 new provider(s) for bafkreignx6d6kfdi6q3sqayf4bef7y54k7ztbhd7gci23wr6cpl2opqqoe +0ms
  helia:trustless-gateway:session:bafkreignx6d6kfdi6q3sqayf4bef7y54k7ztbhd7gci23wr6cpl2opqqoe:error error retrieving session block for bafkreignx6d6kfdi6q3sqayf4bef7y54k7ztbhd7gci23wr6cpl2opqqoe Error: unable to fetch raw block for CID bafkreignx6d6kfdi6q3sqayf4bef7y54k7ztbhd7gci23wr6cpl2opqqoe
    at TrustlessGateway.getRawBlock (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/helia-verified-fetch/packages/verified-fetch/node_modules/@helia/block-brokers/dist/src/trustless-gateway/trustless-gateway.js:108:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async TrustlessGatewaySession.queryProvider (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/helia-verified-fetch/packages/verified-fetch/node_modules/@helia/block-brokers/dist/src/trustless-gateway/session.js:19:23)
    at async raceSignal (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/helia-verified-fetch/node_modules/race-signal/dist/src/index.js:28:16)
    at async Job.run (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/helia-verified-fetch/node_modules/@libp2p/utils/dist/src/queue/job.js:55:28) +1ms
  basic-server timing out request +2s
  basic-server timing out request +87ms
  basic-server timing out request +4ms
  basic-server timing out request +2ms
  basic-server timing out request +1ms
  basic-server timing out request +11ms
  basic-server timing out request +15ms
  basic-server timing out request +10ms
  basic-server timing out request +11ms
  basic-server timing out request +11ms
  basic-server timing out request +9ms
  basic-server timing out request +11ms

I think the problem might be on code in this repo now.

@SgtPooki SgtPooki linked a pull request May 22, 2024 that will close this issue
3 tasks
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 a pull request may close this issue.

1 participant