GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — benchmark: fix net/dgram.js infinite loop by yosuke-furukawa · Pull Request #486 · nodejs/node

Conversation

@yosuke-furukawa

@yosuke-furukawa yosuke-furukawa commented Jan 17, 2015

Copy link
Copy Markdown
Member

benchmark script is not finished. net/dgram.js has infinite loop.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@yosuke-furukawa
benchmark: fix net/dgram.js infinite loop
1258962
@mscdex

mscdex commented Jan 17, 2015

Copy link
Copy Markdown
Contributor

I saw this the other day too, but I'm not sure what impact setImmediate() brings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnoordhuis

bnoordhuis commented Jan 17, 2015

Copy link
Copy Markdown
Member

I think there are two things going on here:

  1. the benchmark hasn't been updated after changes to the dgram binding interface
  2. using setImmediate() this way is an accidental fix; the return value from setImmediate() makes the socket.send() call compatible-ish with the new interface again

EDIT: Sorry, scratch that; I thought this benchmark was using the binding layer directly.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yosuke-furukawa

yosuke-furukawa commented Jan 18, 2015

Copy link
Copy Markdown
Member Author

if this bug is solved, all benchmark tests work fine.

I would like to ask a question. this callback seems to be called synchronously, is this a right behavior?

IMO, UDP does not check reaching the target, so the behavior looks fine.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnoordhuis

bnoordhuis commented Jan 18, 2015

Copy link
Copy Markdown
Member

this callback seems to be called synchronously, is this a right behavior?

If that is what happens, then no, that would definitely be the wrong behavior. I don't think it's that, though. I did a quick check and it seems the callback is just never called. Will investigate.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnoordhuis

bnoordhuis commented Jan 18, 2015

Copy link
Copy Markdown
Member

Okay, perhaps it does get called synchronously somehow.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yosuke-furukawa

yosuke-furukawa commented Jan 20, 2015

Copy link
Copy Markdown
Member Author

I investigate this issue using git bisect.

As a result, I suspect this commit (e49429e) occurs this issue ( deps: update libuv to v0.11.28 e49429e ).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yosuke-furukawa

yosuke-furukawa commented Jan 21, 2015

Copy link
Copy Markdown
Member Author

According to libuv CHANGELOG, I can find a commit " unix: try to write immediately in uv_udp_send libuv/libuv@4189122".

@bnoordhuis I guess this is the reason why socket.send callback is called synchronously. How do I fix this script? setImmediate is OK?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yosuke-furukawa

yosuke-furukawa commented Jan 26, 2015

Copy link
Copy Markdown
Member Author

ping @bnoordhuis ?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vkurchatkin
vkurchatkin reviewed Jan 26, 2015
View reviewed changes
Comment thread benchmark/net/dgram.js

@vkurchatkin vkurchatkin Jan 26, 2015

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it be like setImmediate.bind(null, onsend) ?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bnoordhuis

bnoordhuis commented Jan 26, 2015

Copy link
Copy Markdown
Member

@yosuke-furukawa I appreciate the fix for the test, but if callbacks are really getting called synchronously now, that will have to be addressed. It violates the 'callbacks are always asynchronous' contract.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vkurchatkin

vkurchatkin commented Feb 21, 2015

Copy link
Copy Markdown
Contributor

Closing. This PR doesn't seem to fix anything

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vkurchatkin vkurchatkin closed this Feb 21, 2015
@mscdex mscdex mentioned this pull request Mar 25, 2015
dgram benchmark causes 100% CPU #1254
Closed
@yosuke-furukawa yosuke-furukawa mentioned this pull request Mar 25, 2015
benchmark: disable dgram benchmark #1258
Closed
@yosuke-furukawa yosuke-furukawa mentioned this pull request Apr 1, 2015
dgram: call send callback asynchronously #1313
Closed
@bnoordhuis bnoordhuis mentioned this pull request Apr 4, 2015
udp: callbacks are effectively synchronous libuv/libuv#301
Closed
@yosuke-furukawa yosuke-furukawa mentioned this pull request Jun 1, 2015
test: loosen condition to detect infinite loop #1857
Closed
@solebox solebox mentioned this pull request Jan 9, 2023
[Snyk] Security upgrade debug from 2.6.9 to 3.1.0 solebox/node#32
Open
@enterstudio enterstudio mentioned this pull request Jan 9, 2023
[Snyk] Security upgrade debug from 2.6.9 to 3.1.0 enterstudio/node#30
Open
@fishbar fishbar mentioned this pull request Jan 10, 2023
[Snyk] Security upgrade debug from 2.6.9 to 3.1.0 fishbar/node-1#33
Open
@s4sc s4sc mentioned this pull request Jan 10, 2023
[Snyk] Security upgrade debug from 2.6.9 to 3.1.0 s4sc/node#30
Open
@snyk-bot snyk-bot mentioned this pull request Jan 10, 2023
[Snyk] Security upgrade debug from 2.6.8 to 3.1.0 erdun/node#50
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@yosuke-furukawa @mscdex @bnoordhuis @vkurchatkin
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.