central-backend icon indicating copy to clipboard operation
central-backend copied to clipboard

idea: for streaming responses, send an email on error

Open issa-tseng opened this issue 5 years ago • 4 comments

so, our worst stream response failures have been hangs and spins so far, but still some of them are just plain crashes that we actually have stack traces for. these land in sentry, but our users usually think the server is just taking forever to work on it.

possibly for these particular responses sending the user an email with the error and a stack trace and a link to the forum could be a good idea.

issa-tseng avatar Jun 03 '20 23:06 issa-tseng

That seems like a great idea. Could we also consider triggering a service restart?

lognaturel avatar Jun 04 '20 18:06 lognaturel

i don't think it'll do anything. i get why you're saying that but that wouldn't help in any case this would catch.

issa-tseng avatar Jun 04 '20 19:06 issa-tseng

I see this issue is marked "needs discussion", but it's sounding like this is something we want to do. @lognaturel, what do you think about removing "needs discussion" and adding "help wanted"?

matthew-white avatar May 11 '22 17:05 matthew-white

It would be helpful to get some specific examples of failures.

I think all streamed responses are written with Transfer-Encoding: chunked, which should allow clients to detect and handle broken streams. I can't find this explicitly documented, but it's implied at https://nodejs.org/api/http.html#http_request_write_chunk_encoding_callback.

In addition to this, zip streams should fail to decompress if not downloaded completely, as they will be missing the "end of central directory record".

There have been a number of improvements around stream timeouts recently, which may also be relevant.

ERR_STREAM_PREMATURE_CLOSE may be related, but so far I've only seen that occur when the client disconnects unexpectedly. In that case, the user may be aware that their connection is inactive or unreliable.

alxndrsn avatar Nov 08 '22 09:11 alxndrsn