In many places in the code closures are used to handle requests (see the flink code there). If the fns* list is cleared (say news.arc is restarted or harvest-fnids kills them) then you'll get the message.
The use of closures in this manner means that the code needed to handle say a form submission is really compact and set up when the form itself is generated.
I would be interested to know how much state is in those closures. If it is less than 200 or so bytes, it would not be impractical to encode it (b64) in the url for the next page (rather than a reference to the state).
In particular, harvest-fnids has as maximum number of allowed fnids. If there are too many, it purges any fnids that are older than their expiration time, and the oldest 10%.
Thus, the more fnids created (i.e. the more users), the sooner fnids will get harvested and you'll get the expired error.
It doesn't just happen when writing comments; it can happen almost anywhere on the site if you linger too long. It's the most glaring fault with the software behind this site and would be completely impracticable if this site weren't populated by technology-minded people who aren't bothered by error messages.
I've become accustomed to getting the error when I linger on the page for a bit, and even in that context it's pretty irritating, but tolerable. Just this morning however, I'm able to click on the logo link at top-left, immediately navigate to the bottom, select "more," and get the nasty - that's remarkably dysfunctional.
PG is using a really cool programming technique that I'm afraid is ahead of its time relative to current hardware. An upgrade to the HN server should allay the problem.
To see the potential, look at this code snippet from an academic paper on the topic. The web server presents a form asking for a number, then presents a form asking for another number, then displays their product. This technique makes event-driven web applications feel (to the programmer) like sequential imperative programs.
;; main body
‘(html (head (title ”Product”))
(body
(p ”The product is: ”
,(number→string (∗ (get-number ”first”) (get-number ”second”))))))
It's not so much that it's ahead of its time relative to hardware as it is something you do in the early versions of a program.
Using closures to store state on the server is a rapid prototyping technique, like using lists as data structures. It's elegant but inefficient. In the initial version of HN I used closures for practically all links. As traffic has increased over the years, I've gradually replaced them with hard-coded urls.
Lately traffic has grown rapidly (it usually does in the fall) and I've been working on other things (mostly banning crawlers that don't respect robots.txt), so the rate of expired links has become more conspicuous. I'll add a few more hard-coded urls and that will get it down again.
The HN server uses a table of closures to implement those links (the id code for the closure is the bit after fnid= in the url).
When the HN server starts running out of memory, it drops entries from this table. When your browser asks for an entry that is no longer in this table, you get the "Unknown or expired link" error.
This is a crazy design, but unless someone would like to patch the source code and get PG to accept it, we're stuck with it.
It's not crazy at all, it greatly simplifies development to use callbacks for actions rather than manually encoding the necessary state into the URL. Techniques such as this are what enable a single developer to be so productive by automating boring and time consuming stuff.
The software stores the current state in a closure. The closure gets cached. When the cache is full, the older closures get flushed, hence the error message.
I find it interesting that most discussions I've seen about this exact topic are about Arc and closures... instead of about the fact that this may well be an interesting programming thing to do but it's a moronic user experience thing to do.
Your comment is in a sense its own refutation, because the ultimate test of user experience is whether users continue to use the software.
Getting user experience right depends on the users. I wouldn't use this technique in an online store. Random online shoppers would be confused by expired links, and you'd lose sales. But HN users aren't confused by them. What HN users care about is the quality of the stuff on the site.
Since I can't work full time on HN, I focus on the things that matter most. What I spend my time thinking about is e.g. detecting voting rings. Those affect what you see on the frontpage, which is what users of this site care most about.
Good question, but in my opinion it's somewhat rhetorical. Given bugs like these, the ongoing optimization battle, and fairly reasonable feature requests (see the huge HN topic on that), isn't it about time Paul Graham hired someone full or part time to work all these issues out? Given how important HN is to YC, I would think it's worth it. Are any of these tasks really things pg has to do or are the best use of his time?
Back when it took a lunch break to cause this issue it didn't bother me at all. These days it happens so fast that it is constantly interrupting me while actively browsing through the site.
The first complaints are from 1575 days (over 4 years) ago, including about the more button breaking, so I am guessing pg has no interest in fixing it.
This happens to me a lot while reading HN. I hit "More" and by the time I am done reading a few comments on a handful of entries, the next "More" has expired, and so has the current.
Actually _right_now_ I cannot click "more"(on the first page) without hitting the "Unknown or expired link" page ... so I cannot go past the first page :/ -- Someone should submit a patch :)
Everyone who has literally answered the question "Why?" has completely missed the point. What would PG say about a primary site feature that is so completely broken that it drives users to complain actively, and maybe stop using the site? That it is their problem because they don't understand the technical details? Well, obviously, no one is losing any money here, so maybe that's the answer after all.
I also just tried to log in about 6-7 times in a row (clicking the "login" link on the front page, reloading the front page in between attempts), and I repeatedly received the "expired link" page.
It also reliably happens clicking the "next page" link on the bottom of the front page; by the time I'm done reading the front page the next page link usually expires.
The problem could made less painful by including a link back to http://news.ycombinator.com on the "Unknown or expired link" page. That would save me fishing around with the mouse and the back button to get a new start.
I've been wondering about this for a long time, but just as a data point if anyone cares, it has reached the point recently that HN is basically unusable for me a lot of the time, and I really am starting to give up on trying and spend more time elsewhere instead.
Perhaps one visitor is no great loss -- I'm hardly the personality around here that someone like patio11 is -- but I hope my contribution is constructive, and my comment scores have always suggested so.
However, subjectively, it seems like the quality of posting and voting has taken a sharp nosedive since the "Unknown or expired link" problems have become a several-times-per-session occurrence over the past few weeks. I can't help wondering whether long-standing regular contributors are being put off as a result. If positive contributors can't even log in to refute an objectively incorrect post with a verifiable link or downvote Redditesque diversions, a downward slide seems inevitable, and then the loss of high quality posting and voting becomes a self-sustaining decline.
Funny, I suspect it's just the opposite. Long-standing regular contributors are unlikely to be put off by the error messages, especially if they're technically knowledgeable and understand why the error is occurring.
On the other hand, new users who might not be accustomed to The Way We Do Things Around Here would be more likely to get upset at the superficial inconveniences and leave.
It's probably even the case that improving the site or adding features to it would work against its best interests by making it more accessible. HN's implementation is such that the more traffic it sees, the more frequently those errors will occur -- and as an unexpected side-effect, the popularity and instability of the site will work against each other until equilibrium is reached.
A small barrier to entry like Reddit's spartan design or MeFi's $5 fee can go a long way toward delaying the onset of the entertainment-seeking masses.
[+] [-] jgrahamc|14 years ago|reply
The use of closures in this manner means that the code needed to handle say a form submission is really compact and set up when the form itself is generated.
[+] [-] piinbinary|14 years ago|reply
[+] [-] kens|14 years ago|reply
In particular, harvest-fnids has as maximum number of allowed fnids. If there are too many, it purges any fnids that are older than their expiration time, and the oldest 10%.
Thus, the more fnids created (i.e. the more users), the sooner fnids will get harvested and you'll get the expired error.
[+] [-] DiabloD3|14 years ago|reply
[+] [-] thepointyhat|14 years ago|reply
[deleted]
[+] [-] extension|14 years ago|reply
[+] [-] wvenable|14 years ago|reply
[+] [-] unknown|14 years ago|reply
[deleted]
[+] [-] bradharper|14 years ago|reply
[+] [-] brlewis|14 years ago|reply
To see the potential, look at this code snippet from an academic paper on the topic. The web server presents a form asking for a number, then presents a form asking for another number, then displays their product. This technique makes event-driven web applications feel (to the programmer) like sequential imperative programs.
The paper: http://cs.brown.edu/~sk/Publications/Papers/Published/khmgpf...[+] [-] pg|14 years ago|reply
Using closures to store state on the server is a rapid prototyping technique, like using lists as data structures. It's elegant but inefficient. In the initial version of HN I used closures for practically all links. As traffic has increased over the years, I've gradually replaced them with hard-coded urls.
Lately traffic has grown rapidly (it usually does in the fall) and I've been working on other things (mostly banning crawlers that don't respect robots.txt), so the rate of expired links has become more conspicuous. I'll add a few more hard-coded urls and that will get it down again.
[+] [-] mooism2|14 years ago|reply
When the HN server starts running out of memory, it drops entries from this table. When your browser asks for an entry that is no longer in this table, you get the "Unknown or expired link" error.
This is a crazy design, but unless someone would like to patch the source code and get PG to accept it, we're stuck with it.
[+] [-] gnaritas|14 years ago|reply
[+] [-] icebraining|14 years ago|reply
The software stores the current state in a closure. The closure gets cached. When the cache is full, the older closures get flushed, hence the error message.
[+] [-] tomcreighton|14 years ago|reply
[+] [-] pg|14 years ago|reply
Getting user experience right depends on the users. I wouldn't use this technique in an online store. Random online shoppers would be confused by expired links, and you'd lose sales. But HN users aren't confused by them. What HN users care about is the quality of the stuff on the site.
Since I can't work full time on HN, I focus on the things that matter most. What I spend my time thinking about is e.g. detecting voting rings. Those affect what you see on the frontpage, which is what users of this site care most about.
[+] [-] herdrick|14 years ago|reply
[+] [-] unknown|14 years ago|reply
[deleted]
[+] [-] kristopher|14 years ago|reply
Obviously, it makes sense for someone who is versed in the news.arc internals to fix the problem; nonetheless this issue certainly bugs me.
[+] [-] JohnsonB|14 years ago|reply
[+] [-] brlewis|14 years ago|reply
[+] [-] breckinloggins|14 years ago|reply
1. Open Hacker News
2. Go to lunch
3. Come back from lunch and click next
Every. Time.
[+] [-] georgemcbay|14 years ago|reply
[+] [-] przemoc|14 years ago|reply
[+] [-] gnaritas|14 years ago|reply
[+] [-] adamrmcd|14 years ago|reply
http://ycombinator.com/newsfaq.html
[+] [-] smackfu|14 years ago|reply
[+] [-] Tichy|14 years ago|reply
[+] [-] paulkoer|14 years ago|reply
See here http://news.ycombinator.com/item?id=28944
[+] [-] davidcollantes|14 years ago|reply
This only happens on HN (at least to me).
[+] [-] unknown|14 years ago|reply
[deleted]
[+] [-] d1b|14 years ago|reply
[+] [-] blauwbilgorgel|14 years ago|reply
Else couldn't one set up malicious scripts to up-or downvote many stories, or post comments under someone else's name?
[+] [-] dasil003|14 years ago|reply
[+] [-] odobenus|14 years ago|reply
[+] [-] smountcastle|14 years ago|reply
EDIT: The only way I was able to login was to use the 'add comment' button on this post.
[+] [-] emu|14 years ago|reply
It also reliably happens clicking the "next page" link on the bottom of the front page; by the time I'm done reading the front page the next page link usually expires.
Please fix?
[+] [-] abdulhaq|14 years ago|reply
[+] [-] VBprogrammer|14 years ago|reply
[+] [-] Silhouette|14 years ago|reply
Perhaps one visitor is no great loss -- I'm hardly the personality around here that someone like patio11 is -- but I hope my contribution is constructive, and my comment scores have always suggested so.
However, subjectively, it seems like the quality of posting and voting has taken a sharp nosedive since the "Unknown or expired link" problems have become a several-times-per-session occurrence over the past few weeks. I can't help wondering whether long-standing regular contributors are being put off as a result. If positive contributors can't even log in to refute an objectively incorrect post with a verifiable link or downvote Redditesque diversions, a downward slide seems inevitable, and then the loss of high quality posting and voting becomes a self-sustaining decline.
[+] [-] Tichy|14 years ago|reply
[+] [-] xnxn|14 years ago|reply
On the other hand, new users who might not be accustomed to The Way We Do Things Around Here would be more likely to get upset at the superficial inconveniences and leave.
It's probably even the case that improving the site or adding features to it would work against its best interests by making it more accessible. HN's implementation is such that the more traffic it sees, the more frequently those errors will occur -- and as an unexpected side-effect, the popularity and instability of the site will work against each other until equilibrium is reached.
A small barrier to entry like Reddit's spartan design or MeFi's $5 fee can go a long way toward delaying the onset of the entertainment-seeking masses.
[+] [-] socialmediaking|14 years ago|reply
[+] [-] adamrmcd|14 years ago|reply
[+] [-] mrb|14 years ago|reply
[+] [-] gbaygon|14 years ago|reply