-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Empty UDP datagrams tests broken #8023
Comments
@indutny Sorry, assigning to you. I don't have an OSX machine I can test this on. |
Thank you, I just reproduced it with your scripts! Right now I can confirm that it sends 0-length UDP packet. Trying to figure out why there is no notification after that. |
Surprisingly, the same thing works on FreeBSD so this is not because of the watermark... Or FreeBSD has fixed their kqueue implementation. |
@indutny Did you have some time to investigate more? If so, what did you find out? I may have some time to investigate more during the week-end, but I want to complete a first pass over all failing tests on jenkin's nodejs-master first before digging deeper into this one. |
I believe that OSX has uncofigurable low-watermark on UDP sockets. Right now I'm trying to find some flag or some way to get notification. But it seems very unlikely that there is a way to make it work the same way as it does on other Unixes. |
@indutny Ok. Have you tried using setsockopt with SO_RCVLOWAT set to 0? |
Certainly, it returns EINVAL, I also tried NOTE_LOWAT, but it is ignored if it is less than SO_RCVLOWAT. |
Here is a simplified test: https://github.com/indutny/0-udp |
@misterdjules I believe this is an OSX bug. I have just reported it (# 17894467 ) and submitted a patch. However, it seems that it is working fine in other BSDs only because of some sort of luck :) I'm in the middle of discussing it with FreeBSD people, so I don't have much more details right now. I guess all that we can do right now - is making this test platform specific. So here is a commit: 47a103a |
@indutny My concern with only making the test platform specific is that developers will expect sending empty datagrams to work on OS X as it works on other platforms. I would suggest:
If your patch get merged upstream later, then we can remove the throw on OS X and update the tests. What do you think? |
Well... in fact, it works. Even more, you can receive them. They just don't trigger any events, so you'll need to wait for a consequent UDP packet to receive every of them. |
Not sure if throwing would be helpful if you are communicating with other server. |
Hooray! This one is fixed in El Capitan ;) |
This PR added support for receiving zero-length UDP datagrams. However, It seems that empty UDP datagrams cannot be received on MacOS X with libuv.
As a result, test/simple/test-dgram-send-empty-buffer.js and test/simple/test-dgram-empty-packet.js fail on MacOS X. See jenkin's reports here and here.
I created a repository with a minimal repro of the issue in plain C/libuv . You can have a look at the README to know how to reproduce the issue. This shows that the issue seems to be in libuv itself, or at a lower level.
I haven't had the time to investigate more, but any help is more than welcome!
The text was updated successfully, but these errors were encountered: