4 ms·
I don't think this is what is going on here, it makes no sense for it to operate like this. To demonstrate this is not the case, I just momentarily unplugged my
by nwh 12y ago
I don't think this is what is going on here, it makes no sense for it to operate like this. To demonstrate this is not the case, I just momentarily unplugged my NIC and then submitted this comment. The connection was definitely dropped and re-associated, but my comment passed perfectly fine. This is more likely a very short cache time on CSRF tokens rather than anything to do with associated sockets.
- phamilton 12y agoHttp is stateless, so there are no "known sockets". Every request opens a new socket. Unplugging and plugging back in is a no-op in this context.
- brudgers 12y agoThe architectural model your comment and the initial post assumes to underlay the behavior is incorrect. The reason for 'Unknown or Expired Link' is that HN runs on a webserver that uses continuations to maintain state. The continuations are stored in a table and based on load individual table entries get flushed to make room for new entries as needed. The message is actually always the result of an unknown link because the hash is no longer in the table. Your experiment worked because the relevant continuation [state reference] was available after disconnect e.g. the 'route' so to speak was still valid. Now obviously one might wonder why HN works this way. The reason is that the HN codebase came about as a way of field testing Arc [Graham's 100 year language]. Until rather recently, HN ran on a single server. It still uses relatively few lines of code.
- acdha 12y ago> Now obviously one might wonder why HN works this way. The reason is that the HN codebase came about as a way of field testing Arc [Graham's 100 year language]. This is really the key point: continuations are the wrong way to write this kind of application. It's significantly more work and there's no benefit from doing so but it allowed someone to test a pet idea and, having done so, fixing it would mean admitting that doing something because it's cool isn't good engineering.
- brudgers 12y agoThe kind of application is specifically Hacker News, not a generic website or webserver. See the essay linked here for what kind of application this is: https://news.ycombinator.com/item?id=7651525 https://news.ycombinator.com/item?id=7651525
- acdha 12y agoContinuations are a questionable fit for web applications in general, however. HTTP is stateless and it requires a lot of extra work to build an abstraction which pretends otherwise. I prefer to embrace that from the beginning so the entire design matches the nature of the medium.
- brudgers 12y agoThe explanation is mine. It wasn't an argument. The application and implementation decisions are YC's. The essay explains their rationales.
- nwh 12y agoI know, I was demonstrating why that given explanation couldn't be true.