plnkr / feedback

Feedback on Plunker
19 stars 11 forks source link

500 status code when same file is requested 4th time #544

Closed guest271314 closed 1 year ago

guest271314 commented 3 years ago

Describe the bug 500 status code when same file is requested 4th time

To Reproduce Steps to reproduce the behavior:

  1. Create several approximately 1 second .oga (.ogg) and .opus files

  2. Drag and drop the files to project file tree

  3. Request the files in sequential order in an infinite loop, in pertinent part

          audio.srcObject = msd.stream;
          async function* loop() {
            while (true) {
            for (const url of urls) {
              await new Promise(async(resolve) => {
                try {
                const absn = new AudioBufferSourceNode(ac);
                const response = await fetch(url, {cache:'no-store'});
                const ab = await response.arrayBuffer();
                const buffer = await ac.decodeAudioData(ab);
                absn.buffer = buffer;
                absn.onended =  () => { absn.disconnect(); resolve(); };
                absn.connect(msd);
                absn.start();
                } catch(e) {
                  console.error(e);
                }
              })
            }
            yield;
            }
          }
          for await (const _ of loop());
  4. At the 4th request note that one of the requests for the file will throw a 500 error

    1. leads to DOMException: Unable to decode audio data error when using AudioContext.decodeAudioData() with response from fetch()

Errors / logs in developer tools

GET https://run.plnkr.co/preview/ckkb91dui000f2v6uknvgcs8f/test1.oga 500
(anonymous) @ (index):54
loop @ (index):51
(index):63 DOMException: Unable to decode audio data
(anonymous) @ (index):63
async function (async)
(anonymous) @ (index):54
loop @ (index):51

Expected behavior No 500 or unable to decode audio data errors to be thrown.

Screenshots Screenshot_2021-01-24_07-01-53

Desktop (please complete the following information):

Additional context No errors are thrown when running the same code at localhost.

ggoodman commented 3 years ago

Hi @guest271314 that's a weird one. Especially that you've getting http 500s and only after the 4th request 🤔 . There is a chance that the ephemeral preview is being evicted reliably in a period of time that happens to correspond to 4 iterations of you loop.

Is the behaviour still happening? Can you share a plunk that demonstrates this?

guest271314 commented 3 years ago

The meesages printed at console were interesting. I took a screenshot and posted here in case experiments freeze or crash the OS. At a different OS now. Lost the original code. Will try to reproduce.

guest271314 commented 3 years ago

@ggoodman 500 status code occurs after arbitrary number of requests, could be 2d request

plnkr https://plnkr.co/edit/DjoHuCmBxDa8Z0EE?open=lib%2Fscript.js

plnkr_500.zip

boghyon commented 3 years ago

This is the same issue as https://github.com/plnkr/feedback/issues/261. Previews fail fetching new resources just after a few seconds.

Only run.plnkr.co/plunks/<plunkID> URLs work. See https://run.plnkr.co/plunks/DjoHuCmBxDa8Z0EE/. The loop works there.

ggoodman commented 1 year ago

Hi folks, I've just gone and bumped the lifetime of the previews up a tad more. Hope this helps.