Fail Faster

For a long time I have heard complaints that Xdebug, with its debugger enabled, slows down applications, even if there is no IDE listening.

I have never been able to reproduce this, as on Linux (and macOS), TCP connections to a localhost ports fail immediately if that port is not open.

Xdebug waits for up to 200ms when making a debug connection. This is configurable with the xdebug.connect_timeout_ms setting.

But if there is nothing listening, there should not be any delay, as it ought to be an immediate error.

I wrote a comment in an issue from 2024:

The error message ERR: Time-out connecting to debugging client, waited: 200 ms. indicates that your network stack doesn't immediately reject the connection if it can't be made. That's usually due to a (misconfigured) firewall.

It turns out, that it is not a firewall, but that Windows itself behaves bad here. Instead of failing immediately, it does retry sending TCP SYN packets to try to establish a connection. This is pointless on the local loopback interface, as network packets cannot get lost.

Through a post by Daniel Stenberg on Mastodon, I found out the cause, and a solution.

He explains how it affects curl's Happy Eyeballs algorithm in a blog post from 2024. Although Xdebug does not use Happy Eyeballs, the underlying problem is the same.

Last week, Marcel Jamin wrote to the curl mailing list, with a solution. This solution disables the retry mechanism to establish a connection. And in turn that means, that there is no longer a delay on Windows either.

I have today merged a pull request for Xdebug which implements this solution. The patch is part of the upcoming Xdebug 3.6 release.

Shortlink

This article has a short URL available: https://drck.me/fail-faster-kbh

Comments

@blog nice one

@blog I think it probably is a firewall issue really, unless Windows is ignoring the RST packets that tell it nothing is listening.

That's what happens on linux - the SYN is sent and gets an RST and that is reported as a connection failure with EPORTUNREACH but if you firewall loopback so it doesn't get the RST then you get the Windows behaviour of it retrying SYN packets.

There's nothing special about the loopback handling in linux.

Friday Night Dinner: Zylia

The former TGI Fridays site in Covent Garden has been replaced by a food and cocktail court arrangement. There is a coffee shop and pancake place, but also a few restaurants around the perimeter with their own entrance. One of these is Zylia, a Greek/Cypriot restaurant.

Most of the dishes on the menu are meant for the table, so going with the sharing approach we opted for a selection of cold and warm Mezedakia to start. Their Taramosalata was probably one of the best variants that we've had. It wasn't oily, or overly salty, but thick and flavourful. Some of the bread that we ordered with it had the resemblance of a supermarket burger bun sliced vertically, oiled and seeded. It was also a bit salty, and the pittas served alongside were better.

We also shared the Spanakopita stack, consisting of crispy layers of filo pastry, with generous dollops of soft feta and spinach. The fried cheese croquettes were ball-shaped, and super hot fresh out of the fryer. They came with a sticky honey sauce.

From the Grill, we shared the Sheftalia (caul fat-wrapped pork parcels, think koftas), and the Chicken Souvlakia — marinated chicken thighs with lemon oil and oregano. Both meats were nicely cooked, and also full of flavour.

It is a bustling place, with a young audience. But it was also just a bit too noisy, to the point where it was difficult to have a conversation. The food however is delightful, and our five selected dishes were spot on quantity wise.

Spanakopita Stack
Spanakopita Stack
1 / 6
Taramosalata
Taramosalata
2 / 6
Chicken Souvlakia
Chicken Souvlakia
3 / 6
Sheftalia
Sheftalia
4 / 6
Pitta and Bread Selection
Pitta and Bread Selection
5 / 6
Fried Cheese Croquettes
Fried Cheese Croquettes
6 / 6

Shortlink

This article has a short URL available: https://drck.me/zylia-kb9

Likes

Comments

No comments yet

Friday Night Dinner: Co & Ko

Situated in SOHO, this small restaurant has a large selection of Korean dishes. We didn't fancy the warm soups and broths on such a warm day, but instead opted for the traditional grilled meats. We're sure that the broths would work very well in the autumn or winter.

As our starter we shared a bowl of K Pop Chicken, which turned out to be crispy cubes of chicken with a sweet sauce. For our mains, my wife enjoyed a classic Lamb Bulgogi — pan-fried thin-sliced marinated lamb. I opted for something new from their menu, the Bossam — a 12-hour slow cooked and grilled Pork belly.

One of the reasons why we chose Korean cuisine for this evening, was to try a Korean beer and a Makgeolli. The beer as part of our quest to try a beer from each of the 48 participating World Cup countries. The Makgeolli because it was a style of Korean drink that we had never previously tried. We had the plain variant at Co & Ko, and subsequently purchased a chestnut flavoured option from one of the South Korean supermarkets that seem to be springing up in London.

The food at Ko & Co was nice, and it had a good ambiance. On a hot summer evening we were grateful to be sat in front of the open window. Judging by the rest of the clientele, the restaurant seems to be popular with the Korean community. There was a steady stream of diners coming and going, enjoying the delicious looking food.

After our meal, we were still a little thirsty — it was a hot evening after all — and shared a Soju. An enjoyable and relaxing way to finish our meal. We would definitely return and recommend Co & Ko.

K Pop Chicken
K Pop Chicken
1 / 3
Bossam
Bossam
2 / 3
Lamb Bulgogi
Lamb Bulgogi
3 / 3

Shortlink

This article has a short URL available: https://drck.me/co-ko-kaz

Likes

Comments

No comments yet

Become a Patron!
Mastodon
GitHub
LinkedIn
RSS Feed
Flickr
YouTube
Vimeo
Email

My Amazon wishlist can be found here.

Human-Made Webring
previous | random | next

Life Line