Skip to content

Console logs occasionally skipped before shutdown #161

Closed

Description

const delay = () => new Promise(resolve => setTimeout(resolve, 14));

(async () => {
  console.log('1')
  await delay()
  console.log('2')
  await delay()
  console.log('3')
  await delay()
  console.log('4')
  await delay()
  console.log('5')
  await delay()
  console.log('6')
  await delay()
  console.log('7')
  await delay()
  console.log('8')
  await delay()
})()

Try running this a few times, if you see no output increase delay if you see full output decrese it. At around 11-14ms I see anywhere between no output and full output, with the output sometimes reordered.

Activity

  1. added
    bug
    on Dec 6, 2019
  2. connor4312 commented on Dec 6, 2019

    @connor4312
    Member

    We need a change in the DAP to solve this properly: microsoft/debug-adapter-protocol#85

  3. connor4312 commented on Jul 5, 2020

    @connor4312
    Member

    Update on this since there have been a few duplicates: we now use the behavior of the previous debug adapter where we stringify simple messages directly, so those should not be missed. However, if a message includes complex data that we need to send as variables, we can still hit the scenario I described in the linked issue.

  4. connor4312 commented on Jul 11, 2020

    @connor4312
    Member

    Some improvements made here 02f9147 but the scenario with variable references is still present

  5. connor4312 commented on Sep 16, 2020

    @connor4312
    Member

    Andre Weinand (@weinand) there've been a trickle of reports about this over time.

    Something I could do in js-debug, now that we learned how to delay shutdown while console output is purged, is add an additional delay expecting variables requests for all console lines. But this is not very ideal. Any other suggestions?

  6. connor4312 commented on Mar 31, 2021

    @connor4312
    Member

    Closing as dupe with the flush behavior we have.

  7. added
    *duplicate
    and removed
    bug
    on Mar 31, 2021
  8. removed
    *duplicate
    on Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions