You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
I am still seeing an average 8 second delay when streaming blocks before the stream will emit its data event only if the length argument is omitted or large.
Steps to reproduce the error:
constIPFS=require('ipfs');constpull=require('pull-stream')consttype=process.argv[2];console.log('Instantiating IPFS node');constnode=newIPFS();consthash='QmRm5YAWoudjGj926YKc2PuBFX7vTp2YzqbWFdmqyqWRQS';conststreamFunc=type==='readable' ? node.catReadableStream : node.catPullStream;letdataEvent=false;node.on('ready',()=>{console.log('IPFS node is ready');constreadyTime=Math.floor(Date.now()/1000);// This length value produces the 2 second delay from original issue// const stream = streamFunc(hash, { offset: 0, length: 5000000 });// This will produce the average 8 second delay but so will any large value of lengthconststream=streamFunc(hash);console.log('Stream has been created, waiting for data....');constpullable=()=>{pull(stream,pull.concat((err,data)=>{if(!dataEvent){dataEvent=true;constdataTime=Math.floor(Date.now()/1000);console.log('Stream is receiving data: '+Math.floor(dataTime-readyTime)+' seconds');}}))}constreadable=()=>{stream.on('data',(block)=>{if(!dataEvent){dataEvent=true;constdataTime=Math.floor(Date.now()/1000);console.log('Stream is receiving data: '+Math.floor(dataTime-readyTime)+' seconds');}})stream.on('end',()=>node.stop());}type==='readable' ? readable() : pullable();})node.on('error',error=>{console.error(error.message);})
Note: May want to change the hash value to something in your test env.
Being a stream function, my expectation is that the size of the file or bytes being requested should not have an impact on the time to initial data event trigger. Worth mentioning that I am using go-ipfs as the websocket bootstrap server behind nginx.
Version:
0.34.2
Platform:
Darwin MacBook-Pro.local 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
Subsystem:
Potential Bitswap but not sure
Type:
Bug
Severity:
Medium
Description:
This is a follow up to #1706
I am still seeing an average 8 second delay when streaming blocks before the stream will emit its
dataevent only if thelengthargument is omitted or large.Steps to reproduce the error:
Note: May want to change the hash value to something in your test env.
Being a stream function, my expectation is that the size of the file or bytes being requested should not have an impact on the time to initial data event trigger. Worth mentioning that I am using
go-ipfsas the websocket bootstrap server behind nginx.