CommunitySolidServer / CommunitySolidServer

An open and modular implementation of the Solid specifications

Home Page:https://communitysolidserver.github.io/CommunitySolidServer/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ERR_INCOMPLETE_CHUNKED_ENCODING : Piped stream errored with Lock expired after 3000ms

timbl opened this issue · comments

Environment

$ community-solid-server --version
4.0.1
$ node --version
v16.13.0

Description

It seems on a slow link CSS aborts the GET data stream before it is finished with a 3 sec timeout. The result is the client hangs up as it doesn't get a clear error status that the browser understands and rellays.

Client log:

GET https://timbl.com/timbl/Automation/Library/Mashup/mashlib.js net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK)

Server Log:

2023-09-09T08:20:11.381Z [WrappedExpiringReadWriteLocker] error: Lock expired after 3000ms on https://timbl.com/timbl/Automation/Library/Mashup/mashlib.js
2023-09-09T08:20:11.387Z [StreamUtil] warn: Piped stream errored with Lock expired after 3000ms on https://timbl.com/timbl/Automation/Library/Mashup/mashlib.js

This is expected behaviour. The server has to send out its HTTP status code when it starts streaming the data, which at that point is 200 since no issue has been detected yet. If a problem occurs while streaming, such as the lock timing out because no data got read from the stream for some time, there is no way to change the initial status code that got sent out. We could write an error message to the output stream before closing it off, but that would only be part of the data stream, and not in some standard way for the client to interpret.