WSL: Intermittent, but more repeatable, hang sending/receiving a large buffer over TCP

The symptoms of this issue are similar to those described in #493 . However, the reproducer on that issue has been fixed; this one still reproduces as of build 14376.

Setting up this reproducer is unfortunately a little bit involved… Hopefully manageable, though.

Initial Setup – run the following commands in WSL:

sudo apt-get install build-essential git cmake libboost-all-dev
git clone https://github.com/eidheim/Simple-Web-Server.git
cd Simple-Web-Server
cmake .
make -j4
dd if=/dev/zero of=web/big.dat bs=1048576 count=300

Note that this setup relies on code from this github repository. I have no affiliation with the repository; I found it while looking around online for pre-existing code that did a specific set of things.

Steps to reproduce:

  • Open up two WSL console windows
  • In one, do cd Simple-Web-Server ; ./http_examples. Give the server process a couple seconds to start up.
  • In the other, do curl http://localhost:8080/big.dat >/dev/null

Expected / what happens on real-Ubuntu:

  • curl is successfully able to download the big file

Actual / what happens in WSL:

  • curl occasionally finishes the download, but usually hangs partway through

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Reactions: 4
  • Comments: 29 (26 by maintainers)

Most upvoted comments

Sorry for the lengthy delay; I’ve been busy with some other things lately.

Anyway – I’ve thrown a whole bunch of workloads at build 15007. (15002 had the issue where WSL always consumed a CPU core, and my test machine is only dual-core, so I upgraded right quick when that was fixed 😃 ) I’ve found (and filed) a few other issues, but so far I have not seen a single recurrence of this hang. So, as far as I’m concerned, it’s fixed! Feel free to close.

@sunilmut (and the rest of the WSL team) – thanks! This particular fix is a huge improvement for me personally. In general, I always look forward to each new Insider build because there’s always something new and useful in it 😃

Quick update – I’m using #15002 and have not seen this reproduce. Yay! But I have a collection of things that I’d like to test and I’m still working through them. I’ll post an update when they’ve finished running.

Thanks @aseering for the ping. I am working on the fix for this as we speak. It got more involved that I initially anticipated. Will update soon.

@sunilmut @benhillis – sorry to keep bugging you on this ticket – some questions:

  • Is it useful for me to post (on an ongoing basis) that the reproducer for this issue affects recent builds? I don’t want to spam y’all, but I do want to confirm that, among all the great fixes that you’ve posted so far for other issues, none of them has happened to address this one yet.
  • It sounds like you looked into this over the summer. Do you have any pointers / suggestions for things that might lead to a workaround? Any technical insights about what’s going on? (Even if it’s not something we as users can do anything about; I’m just curious 😃 )
  • Could you share anything about where this collection of issues is on your radar? Do you have telemetry indicating that it’s a frequent thing? Is it just the folks who’ve reported issues like this on github? (Order of a dozen such github reports so far; not all that many in the grand scheme of things.)

If it’s just me and if it’s a difficult fix, I’ll focus on finding a workaround. If it’s lots of people and not such a hard fix, then I’ll bounce at you folks and do what I can to help you fix it 😃