Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Less Crashy gateway. catch stream2 error #1243

Merged
merged 1 commit into from
Mar 3, 2018

Conversation

ya7ya
Copy link
Contributor

@ya7ya ya7ya commented Mar 2, 2018

This catches the following error. which results in a less crashy gateway as mentioned here #804 (comment)

 Error: write after end
    at writeAfterEnd (/media/op/w3/js-ipfs/node_modules/readable-stream/lib/_stream_writable.js:288:12)
    at PassThrough.Writable.write (/media/op/w3/js-ipfs/node_modules/readable-stream/lib/_stream_writable.js:332:20)
    at pull.through (/media/op/w3/js-ipfs/src/http/gateway/resources/gateway.js:134:21)
    at /media/op/w3/js-ipfs/node_modules/pull-stream/throughs/through.js:17:24
    at drain (/media/op/w3/js-ipfs/node_modules/stream-to-pull-stream/index.js:141:18)
    at Stream.<anonymous> (/media/op/w3/js-ipfs/node_modules/stream-to-pull-stream/index.js:150:5)
    at Stream.emit (events.js:159:13)
    at next (/media/op/w3/js-ipfs/node_modules/pull-stream-to-stream/index.js:120:13)
    at /media/op/w3/js-ipfs/node_modules/pull-stream/throughs/map.js:19:9
    at /media/op/w3/js-ipfs/node_modules/pull-traverse/index.js:42:7

License: MIT
Signed-off-by: Yahya ya7yaz@gmail.com

License: MIT
Signed-off-by: Yahya <ya7yaz@gmail.com>
@ya7ya ya7ya changed the title catch stream2 error Less Crashy gateway. catch stream2 error Mar 2, 2018
@daviddias
Copy link
Member

@victorbjelkholm Jenkins is not happy anymore:
image

@daviddias daviddias merged commit 5b40b41 into ipfs:master Mar 3, 2018
JonKrone pushed a commit to JonKrone/js-ipfs that referenced this pull request Mar 3, 2018
License: MIT
Signed-off-by: Yahya <ya7yaz@gmail.com>
@victorb
Copy link
Member

victorb commented Mar 5, 2018

@diasdavid seems to be about LocalStorage (or similar) has reached the maximum amount of storage allowed.

@daviddias
Copy link
Member

@victorbjelkholm It is IndexedDB related.

The maximum browser storage space is dynamic — it is based on your hard drive size. The global limit is calculated as 50% of free disk space.

and

here's also another limit called group limit — this is defined as 20% of the global limit, but it has a minimum of 10MB and a maximum of 2GB.

Source: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Browser_storage_limits_and_eviction_criteria

@victorb
Copy link
Member

victorb commented Mar 6, 2018

I left this comment somewhere else (on the commit itself I think) but can't find it so leaving it here as well just in case.

While I agree that this patch fixes the particular issue with write after end, it doesn't feel like the completely right fix. We have more uncaught errors/promise rejections that are not solved by this. We need a real fix that catches all errors within the gateway + daemon and prints them, while leaving the gateway + daemon still running.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants