123 points · by eterm · 1y ago · 186 comments
Screaming into the void of the blogosphere is catharsis for getting my SO question closed.
And because I know you're all nosy, the SO question is here: https://stackoverflow.com/questions/79605462/high-cpu-usage-... . Please feel free to point out more ways in which I screwed up asking my SO question.
I will say, this is a level of question that is too sophisticated for SO, and likely will only have an answer once you figure it out and go back and answer your question.
Are you confident the code is the issue--have you repro'd it consistently with different versions of .NET? What about reproing on different machines? Locally?
I had the same suspicion though, which is that if the question is too difficult it triggers some reflex...
Could it be that, for years, they've been selecting for things like:
- Low friction onboarding
- Upvoting “easy wins” and thought experiments over real-world, in-the-trenches problems
- Penalizing questions that didn’t fit the format—even when those of us around since the early days knew they’d likely get good answers within a few days
- Incentivizing moderators to strictly enforce rules that, frankly, weren’t necessarily great to begin with
Just a thought.
It was immediately closed as off-topic with 3 votes. One commenter asked "can't you figure that out using developer tools?"
It was eventually reopened, but I'm never asking a question there again. FWIW one of the governing web bodies essentially says "If you have technical questions, ask them on SO and not here" - I take this to mean that they don't care if you are able to answer your question, they just want you to go away.
Was it so important for the quality of the site to delete a reply thanking someone for their OSS contribution? Is SO a better site now? Meanwhile they have 10 year old answers still up, with no way to indicate they are outdated unless the author themselves goes through the trouble of updating their answer.
Or at least that is my guess, since I stopped working with WCF about 2016 probably.
Anyway in newer version of .net you CancellationToken everywhere what would do exactly that: tell your server that client disconnected. That would be my first try on fixing it.
Use token that is sent via HTTP implementation to the endpoint, pass it to your stream and when it is cancelled, end the stream. Stream ends, endpoint finishes, not CPU load.
Using has similar problems with things like database connections remaining open.
If S.O. believes that deleting everything users post there is somehow improving their site and going to make it relevant again, more power to them. It's their site. Let's see how that goes for them.
(Edit: it seems people do care about CoreWCF ITT. That's nice to see.)
> Screaming into the void of the blogosphere is catharsis for getting my SO question closed.
That's fine. Almost everyone who comes to SO, in my experience, has a fundamentally wrong idea about how the site is intended to work. That includes people who don't have a question and only want to post answers. Unfortunately, it's difficult to explain because people find the model unintuitive - the UI affords using the place just like many others, even though the site was created exactly to get away from frustrations caused by older models (https://meta.stackexchange.com/questions/92107). And the real objective is a synthesis of many not-always-compatible ideas (https://meta.stackoverflow.com/questions/254770). My personal sense is that the community didn't really get a handle on "what SO is" until around the time that new question volume peaked (way back in 2014).
Even then, people can hang around for years and not really get it (e.g. https://meta.stackoverflow.com/questions/427224) - in large part because the policies have been inconsistently applied on a volunteer basis, and the people who are allowed to e.g. cast close votes are vastly outnumbered.
We generally don't care about people not liking the Stack Overflow model while discussing it off-site. There's far too much of that to worry about. But that doesn't mean we'll change to accommodate everyone else. The entire point is to provide something that isn't available everywhere you look: a polished artifact, an organized repository of commonly-needed, high-quality answers to clear, focused, practical questions.
Do we accomplish that goal? Hell no, not by a long shot. But there are some real gems in there - and a few of them have millions of views. And as the rate of new questions slows, users who put on the "curator" hat become able to keep on top of the incoming queue, filter through for what's of value (and not a duplicate), and even turn attention towards the old Q&A to improve it (incidentally, a lot of that work is rounding up old duplicates that went unnoticed).
> I had forgotten that any external links are a big no-no in SO land, so my question immediately attracted 2 close votes.
The problem isn't simply including an external link (we'll happily just edit those out if they aren't necessary). The problem occurs when a question appears to depend upon the externally linked content. We can't accept that (https://meta.stackoverflow.com/questions/254428) because of link rot and licensing issues (someone who wants to answer you often needs to be able to cite the code; posting on-site automatically licenses the content appropriately, per the terms of service) but mainly because of scope - a question that's suitable for the Stack Exchange format would fit neatly within the actual question text.
We don't want to do detailed analysis of the problem you encountered, even if we're capable of it, because questions are for everyone. They need to be able to reflect a problem that other people could a) have; b) plausibly search for; and c) recognize if they found it. Answers to a question need to make sense in general to people who would ask - not just in the specific context of one person's original problem. In short, we want a question, not a problem - and extracting a proper question starts with (https://meta.stackoverflow.com/questions/261592) your own analysis.
"How do I do X?" questions are usually much easier to ask in the format, and are very valuable and can end up very well regarded, even when they're on very basic topics. But "what went wrong with Y code?" is not fully refined. What we're really looking for is more like "why does Y' code construct do Z?" - where the specific, exact cause of failure (https://stackoverflow.com/help/minimal-reproducible-example) is extracted from your own debugging session (along with reproducing input and actual vs expected output).
> Two days later my question got it's third vote for closure, and remains unanswered and now closed forever.
This is literally not how Stack Overflow works. The OP has at least (https://stackoverflow.com/help/auto-deleted-questions) 9 days to fix the question and nominate it for reopening until it gets "deleted"; but even then it's a soft deletion (delisting) which is still reversible - you can find the question from your personal listing (https://stackoverflow.com/users/deleted-questions/current while logged in; or replace 'current' with your user ID), edit and nominate for undeletion.
The established policy is that we intentionally close questions that don't meet standards (https://meta.stackoverflow.com/questions/417476) as quickly as possible (https://meta.stackoverflow.com/questions/260263). The main point of this is to prevent the sort of people (notice that https://meta.stackoverflow.com/questions/271684 is over 10 years old; and the original complaint https://meta.stackexchange.com/questions/9731 is from before the official launch, during the private beta) who would otherwise hang out on a traditional discussion forum 12 hours a day from trying to read the OP's mind, repost the same basic explanation of the same basic idea dozens of times, etc.
(Unfortunately, the incentive system is completely broken - https://meta.stackexchange.com/questions/387356 - and the company's interests are not aligned with the community, so this is a losing battle.)
And, in fact, your question has been reopened, as of about 3/4 of an hour after your comment that I'm replying to. Stack Overflow is not at all immune to external pressure - after all, many regulars there are also on HN and other usual-suspect sites.
It also looks like your edits have actually improved the question. In particular, adding in a definite conclusion from your profiling attempt.
(We understand that a lot of people in a situation like yours wouldn't necessarily know how to use a profiler and wouldn't necessarily be able to come up with a theory about what's wrong. That isn't our problem. We aren't offering tech support. It's a bitter pill for almost everyone, but Stack Overflow by design is not there to make your code work. It's there to answer questions that arise during your attempt. And a question like yours, properly refined, can help those other people.)
True. I quit trying to do anything there once I realized that SO was fundamentally not useful to me. It advertised as a gamified Q&A platform, but was actually a knowledge base psudeo wiki thing structured in way that didn't lend itself to answering the questions I needed answered.
So, I think a lot of the negative reactions are deserved, because SO looks like something it isn't.
People want a place to get help. SO looks like a place to get help. But SO is a place to ask for help only if your problem fits a specific set of requirements. And since most problems will never meet said requirements, most people can never actually get help on SO.
I post this in part because I'm still saltly about how much time I wasted trying to get help only to get downvoted, but also because if SO actually wants to do what they say, they really need to restructure into something that actually looks like what they want to be.
My suggestion would be to have two sites, one that is actually a general Q&A site like what everyone is after, the other is the kind of knowledge repository that SO wants to be. Then you just promote the really good questions from the Q&A site into the other site.
I'd also recommend ending the whole "downvote" idea. I have yet to see it not result in cliques and in discriminating against viewpoints the people with downvote permissions don't like. Let a lack of upvotes cause poor content to drop to the bottom.
I recommend looking for alternatives, because this problem can't really be fixed and the site owners seem intent on making it worse. I personally use and recommend (and am a moderator at, full disclosure) Codidact Software: https://software.codidact.com/ . But at Codidact we're still fundamentally using the same "Q&A site" (I don't think this means the same thing you appear to think it means) model . We just have proper community involvement (the site is owned by a non-profit foundation and committed to community sovereignty; see https://codidact.org/), new site software, and newly conceived site scope.
> My suggestion would be to have two sites, one that is actually a general Q&A site like what everyone is after, the other is the kind of knowledge repository that SO wants to be.
The problem is that there are already countless sites "like what everyone is after". If you try to split a Q&A site like Stack Overflow that way without changing the actual UI, the problem just repeats itself: people try to use the knowledge repository part as if it were yet another traditional forum.
And it turns out, people often think they're after that model, then get fed up with it over time.
I think an idea like yours can be done, but it would require radically different site software. (In early 2023 - I think - I kept myself busy with contemplating a design for exactly this, but I didn't really write anything down.)
The current state of SO is what it is, but saying this is how it was intended to be is 100% revisionist history.
Also "we" "our"... do you work at SO?
My statement that the site was intended to be this way is based on literally years spent trawling through old meta discussions and discussing how the site is supposed to work with other regulars who care(d) about figuring that out - a discussion informed both by statements made by Atwood and Spolsky themselves, as well as years of experience seeing what was and wasn't working. The fact that the site didn't actually initially work as intended, doesn't in any way negate that vision. Basically nothing works as intended out of the gate, especially not when the "thing" is an attempt to organize a community around a piece of software.
1) clearly technical
2) reproducible
3) has a clear failure condition
Not be a suitable candidate for S/O?
Did we step into a dimension where only "How do I print('hello world')?" is a valid question while I wasn't watching, because it has a trivial one-line answer?
Hard questions doesn't mean they're bad, it just means many people aren't competent answer them. The same goes for obscure questions; there might just not be many people who care, but the question itself is entirely valid.
Does that mean they're not suitable for S/O?
I... can't believe anyone seriously believes that hard niche problems are too obscure or too hard for S/O to be bothered to grace themselves with.
It's absurd.
It just baffles me that a question that might take some effort to figure an answer out to might 'not be suitable' to S/O.
Is it? What hardware and OS version should I use to reproduce the server?
The problem is complexity and scope.
We don't debug code for others. We expect them to find the specific part of the code that is causing a problem and showcase a minimal reproducible example. For performance issues, we expect them to profile code and isolate bottlenecks - and then they can ask a hard, obscure question about the bottleneck. Or a very easy one, as long as it's something that could make sense to ask after putting in the effort.
In short: we're looking for a question, not a problem. Stack Overflow "can't be bothered to grace itself with" hard niche problems, or with easy common problems. But it is about answering the question that results from an analysis of a problem. Whether that's understanding the exact semantics of argument passing, or just wanting to know how to concatenate lists.
And we're looking for one question at a time. If there are multiple issues in a piece of code, they need to be isolated and asked about separately. If the task clearly breaks down into a series of steps in one obvious way, then you need to figure out which of those steps is actually causing a problem first, and ask about whichever steps separately. (Or better yet, find the existing Q&A.)
(Questions seeking to figure out an algorithm are usually okay, but usually better asked on e.g. cs.stackexchange.com. And usually, an algorithm worth asking about isn't just "do X, then do Y, then do Z".)
Stack Overflow is full of highly competent people who are yearning for questions that demand their specific expertise - recently, not just in the 2010s.
Most questions I've asked since 2020 were deliberate hooks to deal with common beginner-level issues or close FAQs that didn't already have a clear duplicate target. (I've stopped contributing new Q&A, but still occasionally help out with curation tasks like editing.) But I asked https://stackoverflow.com/questions/75677825 because I actually wanted an answer, and it's an instructive example here.
Answering it required detailed expert-level knowledge of modern CPU architectures and reverse engineering of the Python implementation. Asking it required noticing a performance issue, then putting extensive effort into simplifying the examples as much as possible and diagnosing the exact qualities of the input that degrade performance - as well as ruling out other simple explanations and citing the existing Q&A about those.
But demonstrating it requires nothing more than a few invocations of the `timeit` standard library module.
Tangentially, one thing I think StackOverflow misses in its policy is in not allowing questions that ask for help to evaluate libraries and products in the developer space. There are many questions on SO where someone has asked what is the best library for X, and the question is closed due to site policy, but I think a discussion of what library is best for a use case is a very useful thing to have on SO. The answer to the question can change over time, and multiple alternative solutions can be presented. This is the kind of thing that Reddit has taken over for many different product recommendations, but reddit answers are just comments, they don't have the UI of SO's for commenting on questions and answers.
With pleasure! SO is definitely more of a distinct Q&A site and not a discursive, open-ended collaborate and problem-solve site.
I posted a question[1]. Got some answers, but not quite complete. Then someone came along and provided a good detailed answer. A couple of upvotes later, that answer got deleted by Community Bot. I voted to undelete it, but it still needs another vote to undelete. So I ended up copying it into my own notes blog[2].
I'm not sure why the best answer was deleted. It would've been a loss if it wasn't preserved somewhere I think.
[1]: https://stackoverflow.com/q/73954228/155351
[2]: https://notes.max.engineer/creating-common-interfaces-in-gol...
It looks like the answer you're talking about is now undeleted, with yours among the three necessary votes. (It also looks like you accepted, and awarded a bounty to, a different answer back when you asked, and the answer you're now calling "best" was posted months later. So it goes.)
The explanation for the original deletion is exactly as ayhanfuat says. LLM and other GenAI content is forbidden on Stack Overflow (https://meta.stackoverflow.com/questions/421831/), since before that answer was posted, and the author (one of the site's most prolific contributors) got in trouble for a flood of such answers. (It took quite a while for the problem to be noticed and acted upon, in large part because of a moderation strike in June 2023 which ended up creating a large backlog of flags for AI content, and in part because custom flags are required to report this. The strike, in turn, was largely about the company/staff trying to interfere with moderators attempting to detect AI content, with the site owners being unwilling to accept false positives because it would be "unfriendly". So it goes.)
Thank goodness I can see it because I have enough reputation.
The CoreWCF folks would be delighted to have a reproducible example, and they are best suited for answering the question. They have written CoreWCF after all! And if you don’t feel comfortable with raising issues? There’s also a Discussion feature on GitHub, where you can ask more free form questions.
And once you fixed or analyzed the issue with the CoreWCF team, you could write a blog post about it and share it with anyone having a similar issue.
That’s how I do these things.
"Bindings MAY provide for streaming when processing messages. That is, SOAP nodes MAY begin processing a received SOAP message as soon as the necessary information is available. SOAP processing is specified in terms of SOAP message infosets (see 5. SOAP Message Construct). Although streaming SOAP receivers will acquire such XML infosets incrementally, SOAP processing MUST yield results identical to those that would have been achieved if the entire SOAP envelope were available prior to the start of processing. For example, as provided in 2.6 Processing SOAP Messages, identification of targeted SOAP header blocks, and checking of all mustUnderstand attributes is to be done before successful processing can proceed. Depending on the representation used for the XML infoset, and the order in which it is transmitted, this rule might limit the degree to which streaming can be achieved."
https://www.w3.org/TR/soap12-part1/
The critical note is the output for streamed, or buffered must the the same so it does not look like infinite streams can be supported.
I also played with your sample application to see if there was any indication of the connection dropping.
I had an interesting result switching to the NetTcp binding. On the client it is unable to exit until the max size of the incoming message is hit. The server continues running as there are no sent message quotas.
After a while, I stopped having to post questions about "common frameworks", either because I could do with the official docs of because there was already a StackOverflow answer for my question.
What was becoming more common was that I would have a question similar to an existing unanswered one. Or that my question would never receive an answer (presumably because my questions were becoming more tricky/niche). So what I started doing was answering my own question (or answering those existing unanswered ones) after solving it on my own. Still, it was fine and I was contributing.
And for some reason, a few years ago my questions started being closed for no apparent reason other than "those who reviewed it have no clue and think that it is invalid". Many times they closed even though I had posted both the question and the answer at the same time (as a way to help others)! The first few times, I fought to get my question reopened and guess what? They all got a few tens of votes in the following year. Not so useless, eh?
Still, that toxic moderation hasn't changed. If anything, it has gotten worse. So I stopped contributing to StackOverflow entirely. If I find information there, that's great, if not, I won't go and add it once I find a solution for myself. I am usually better off opening an issue or discussion directly with the upstream project, bypassing StackOverflow's moderation.
I heard people mentioning that LLMs were hurting StackOverflow badly. I'm here to say that what pushed me away was the toxic moderation, not LLMs.
I have a rep that is based almost entirely on questions, not answers. I learned to ask questions fairly well (to the point I seldom get answers -there's a price to pay, for questions that are very specific).
In some cases, the question is a basic one, and doesn't need a code listing and sample project. It's still a perfectly valid, pertinent, thoughtful question, but not very verbose.
Those questions almost always get closed.
I have found that asking LLMs doesn't always get me the best answer, but I get an answer. In some cases, I can have an iterative refinement, where I keep adjusting the question, until I get a useful answer.
I've never gotten code from SO, that I can use without modification, but I have gotten some great answers, over the years, and have expressed gratitude and respect.
I have gotten quite annoyed with the "attitude" that is often expressed. There's no doubt that folks who ask questions, are considered "lesser beings" on SO. Just look at the question-to-answer ratio of the high-score individuals. Weird attitude, for a site that is pretty much completely reliant on questions.
Basically, I have just given up on SO, and have found LLMs to give me what I used to get from it.
In my opinion, they have killed SO.
And because recourse is so hard and goes trough the same gatekeepers anyway, they don't get any signal about the accuracy of the maintenance.
One of the reason I've left as well was bureaucrats wrecking havoc to perfectly reasonable answers trying to rack up these points.
Peak of the fenomenon was 2014 when people started publishing their so scores on their resumes, but the platform never really recovered.
Could you describe this? A lot of people seem to believe that closing or duplicating questions awards reputation. It doesn't.
The complete list of reputation gain sources is at https://stackoverflow.com/help/whats-reputation
This. It is exactly the problem with incentives.
At some point I was wondering why Tor was not offering incentives, which is something Nym was talking about. And I found an explanation on the Tor website that said something along those lines: "we thought about incentives, but we decided that we wanted contributions from people who cared, not from interested people". Makes sense to me.
If only. Sorry to say, all of this curation effort happens purely by intrinsic motivation - a desire to see a better-curated site.
It's objectively a good thing when more questions get closed (including marking duplicates) because the overwhelming majority of what gets posted is nowhere near meeting standards, and because those standards have been carefully considered with the site's goals in mind.
Those goals just don't happen to match the goals of the overwhelming majority of people who come to ask a new question on Stack Overflow. That's because they don't understand the site's purpose. There is a tremendous amount of misinformation out there (and the site owners are at least complicit in this, because it drives traffic).
In point of fact, my reputation increased the most during a period when I barely used the site at all, because I accumulated votes on answers I'd already written. And I didn't care about any of that, because it gets you absolutely nothing past IIRC about 35000. (The last privilege - https://stackoverflow.com/help/privileges - is awarded at 25000, but past that you can get an increase in the number of flags and votes you can cast daily. It would take an unimaginable level of obsession with the site to ever run out of validly raised flags, but I have run out of closure votes on several occasions.)
When I came back, I started actually paying attention to the meta site and understanding how Stack Overflow is actually intended to work, instead of just being another random person trying to contribute expertise. And my reputation has actually levelled off and declined, mainly because I award generous bounties for existing exceptional answers, or to promote the few high-quality questions I find that need a better answer (especially, questions that I'd like to use as a duplicate target, but wouldn't provide others asking the question with a good enough answer).
> bureaucrats wrecking havoc to perfectly reasonable answers trying to rack up these points.
It's not bureaucracy and it isn't "trying to rack up points". You get two reputation points for an accepted answer, only if you don't already have at least 1000 points and only if you get two out of three users with unilateral edit privileges to agree that it's a good edit (and they, in turn, are incentivized to steal your edit - not for reputation, but because they can get it published unilaterally instead of waiting for someone else to approve). You can't even reach unilateral edit privileges this way, since you need 2000 points for that.
Among people making edits unilaterally - both to questions and answers - this is overwhelmingly motivated by good faith attempts to improve quality. "Perfectly reasonable" is not the standard. The standard is "as good as the available attention allows" (ideally, people focus on more popular content). When you post on Stack Overflow, you license the content to the community (and separately also to the site and company) and they are absolutely within their rights to make good faith edits. If you want to share "your" ideas with the world and not allow others to touch, use a blog.
As I said, those were pretty specialised questions, you can't expect to have 10 upvotes in the first day for those.
I'm happy to hear it. This is how it's supposed to work. If the system were properly designed, questions would start out closed - that is to say: the community would have a chance to fully refine the question and ensure that it meets the site's standards, before people were allowed to write answers.
(The new Staging Ground implements a form of this, for a small selection of new questions.)
The point is to ensure that everyone who has the same question can have an optimal experience by finding it: they should see a question that's easy for them to read and understand; they should easily be able to verify that it's the same question (even though it came up in a radically different context for someone else); they should be able to come across it with a search engine (so the title should make sense, etc.); and it should be properly focused. Then they can scroll down - ideally, not very far - and see the answers, already written, without themselves having to ask again and wait.
> you can't expect to have 10 upvotes in the first day for those.
Ultimately, the thing that gets a question 10 upvotes in the first day is off-site exposure. That's not how it's supposed to work, but the Internet is what it is.
Having met many SO power users in group settings over the years, I feel that there is very little tolerance for questions that require effort to understand. If it's a simple question posed by a non-English speaker that needs some thought, then it doesn't belong (but that's why comments were introduced later.) The same goes for a deeper technical question where the author gets it all out but doesn't take the time to structure or format it. The volume of behavior like this differs based on the type of question and experts prepared to weigh in.
This gets compounded by the up and comers on the reputation scale. They get their special powers and see this BOFH close behavior and replicate it. Over time it starts to become the norm. I had the ability to vote for reopens and these same people would argue about why this was a bad idea. They weren't prepared to admit they were wrong and felt they were doing God's work by ridding the site of poor questions when some of us even had the ability to make edits to clarify them.
I just opened the site after some time away. At the top, pushing the question list below the fold, are: Reputation, Badge Progress, and Watched Tags blocks. The Interesting Posts for You question feed is below that and I have to go see how that is constructed. I only ever wanted the firehose of new questions with my tags highlighted.
EDIT: The behavior I noted above is yet example of why I always want to know how a job candidate deals with ambiguity. In my experience, this has a massive impact on the ability to work independently, not piss off colleagues/clients/customers, and make good decisions.
No, that's not why. If we can understand the English, we edit to fix the English.
We constantly get questions by native English speakers that are nevertheless barely comprehensible. Even when the problem is clearly described, it still needs to meet several other standards (https://meta.stackoverflow.com/questions/417476/). This is by design.
We aren't closing questions because we want to close questions. We're closing questions because they need to be improved by the OP (i.e., fixing the question requires OP's perspective or knowledge) before they are compatible with the site's objectives, which do not necessarily align with yours as a person who has a question.
This is not a punishment and is not in general a permanent state. Closed questions can be, and are, re-opened if the problem with the question is fixed (without fundamentally changing it).
> I just opened the site after some time away. At the top, pushing the question list below the fold, are: Reputation, Badge Progress, and Watched Tags blocks.
And the people doing the majority of the curation work do not care in the slightest about reputation or badges. I certainly don't.
The users with the most reputation are generally the ones who spend hours a day answering easy questions that don't come anywhere close to meeting the site's standards (not because they're easy, but because they're terribly asked and probably duplicates) after doing a bit of mind-reading to figure out what the terribly-asked question is (or scanning through a couple dozen lines of code for trivial problems without really reading the question - because they usually don't need to) and getting a quick upvote and accept from the OP.
Questions like that have ruined the site and continue to make it worse - by diluting search results, by making it harder for curators to find the "canonical" targets for closing duplicates, by click-baiting away from questions other people actually want to find (e.g. by describing a completely different problem with all the same keywords, or by completely misidentifying what's wrong), and most of all by the broken-window effect (bad content examples overwhelm good ones).
But the reputation system rewards people who answer those questions. (The obsessive answer writers I complain about the most in Stack Overflow chat often have 10x or more my reputation.)
Curators have had a goal of closing bad new questions quickly (https://meta.stackoverflow.com/questions/260263), trying to beat the answer to the punch. But answer-writers get a grace period, and can fill in a stub answer and edit it later; and they can act unilaterally while curators usually have to come to a consensus.
It requires either:
* Three votes (it used to be 5) from community members with the close vote privilege (awarded at 3000 reputation)
* Unilateral closure by a moderator (there are currently 24 of these: https://stackoverflow.com/users?tab=moderators - compare to 29 million user accounts: https://data.stackexchange.com/stackoverflow/query/1877958/c... )
* Unilateral closure as a duplicate by a user with the close vote privilege who also has a gold badge for one of the tags originally used on the question (https://meta.stackoverflow.com/questions/254589)
The thresholds are deliberately fairly low, mainly because closure of new bad questions must happen promptly for the site to work as intended (https://meta.stackoverflow.com/questions/260263). This is frankly a major fault in the site design; but the new Staging Ground feature (https://meta.stackoverflow.com/questions/430404) helps a lot, on the occasions when the site software actually decides to use it.
However, "closing" content "that's viewed a lot" (this basically only ever means old questions; new questions rarely ever get a lot of views, regardless of quality, unless it's from spambots - see https://meta.stackoverflow.com/questions/431084) is emphatically not wrong. We close old, popular questions all the time, because they don't currently meet site standards (usually, because they are no longer deemed on topic). This is at least partly to discourage new questions along the same lines; but the primary effect of closing a question is to prevent answers from being contributed. These old questions generally wouldn't need new answers (although edits to existing answers may be helpful - and are not blocked) even if they were still considered suitable.
It's common for those to get shouted down based on some policy or other bureaucratic nonsense by those who have no idea what the question is actually about. The problem could be that many of those who don't do, moderate. It attracts different sorts of people than those that are actually working with the things being discussed.
1. First and foremost, it's not a democracy if your turnout is too low. The 2024 election had voter turnout of 2%, which would be a catastrophic turnout in any real democracy. Either too few knew about the election, too few thought their vote mattered, or too few had any idea how to choose between the options. Any of these reasons requires immediate and pressing attention if a democracy is to be called that.
2. Never having re-elections makes it useless. For it to be a truly democratic process there absolutely needs to be a way to withdraw consent from a moderator who behaves differently than expected. So yeah, a no confidence vote would be an option, or better yet regular elections to hold a position.
I'm afraid that the largest problem is that democracy is really just a bad fit for this kind of site. By its nature the only people who are likely to vote in this type of election are a small dedicated core, not the enormous number of users that the site actually serves. A small core of contributors to a community resource invariably seems to develop a sense of "us against the world"—the thin blue line of police lore isn't an isolated thing, it's what happens when people view themselves as lone defenders of something they care about. And just like with police, that can result in a toxic culture that begins to actively degrade the plebian outgroup that they started out serving.
I don't have a better answer, but I don't believe democracy is a good fit for moderators on the scale of community that Stack Overflow operates. It's too big to have good turnout, and the problems caused by bad turnout have become catastrophic.
Notwithstanding everything else I said above about how "moderation" is actually almost completely irrelevant here, and the overwhelming majority of what people call "moderation" is in fact curation done by community members in more or less a direct democracy:
We have elections annually (https://stackoverflow.com/election), and so does each Stack Exchange site generally. Moderators generally must voluntarily step down barring a major problem; but this was carefully considered at the start (https://meta.stackexchange.com/questions/984).
> For it to be a truly democratic process there absolutely needs to be a way to withdraw consent from a moderator who behaves differently than expected.
This is a strange requirement to me. Do parliamentary democracies have this feature? I don't think so. And they are "truly democratic" in my book.FYI: I have been part of SO.com for about 15 years. I am regular on both sides of the Q&A. Never once have I felt compelled to vote in any election on SO.com. The site admin is totally uninteresting to me.
With the usual model, I can just negotiate directly with management and they can tell me yes or no, and we can make a contract (or be a bit vaguer and make promises).
With worker democracy, there's no one I can negotiate with that can tell me anything definitive.
But it often isn't, they just didn't spend enough time to see nuance.
And neither do they see that even if _they_ understand that the question linked to is the same thing, there is no way the asker can understand what the similarity is from their knowledge point of view (or why the linked duplicate question is the same question).
> But it often isn't, they just didn't spend enough time to see nuance.
As a gold badge holder (for Python and a few other things), I see this complaint constantly. It is without merit ~90% of the time. The simple fact is that the "nuance" seen by the person asking the question is just not relevant to us, because the point of the site is not to give you a personalized answer, but to build a reference where the questions are useful to everyone. This entails collecting useful answers together so that people with fundamentally the same question can all find them, instead of it depending on how lucky their search engine of choice is feeling today.
The meta site has historically been flooded with people trying to reopen blatant duplicates based on trivial distinctions, at the level of "no, I want to get the Nth item of a list, not a tuple". That isn't a direct quote, but it's not an exaggeration either. I wish it were.
We do make mistakes, in part because there's pressure to act quickly. It's much harder to keep the site clean when answers get posted where they shouldn't be. Closing questions prevents answers from coming in.
> there is no way the asker can understand what the similarity is from their knowledge point of view (or why the linked duplicate question is the same question).
I try to leave a comment to explain the connection when it isn't obvious. (Another common thing that happens is that the problem someone wants to solve involves an obvious two- or three-step procedure, and each step is a matter of fundamental technique that's already been explained countless times.) But overall, it isn't our goal to teach. We answer very simple questions, and very difficult questions; but we aren't designed to teach. Sometimes it's hard to ask a simple question, because you have to figure out what the question is first. It's unfortunate that people who need the question answered often don't have that skill. But if we have a high quality version of that question already, we can direct people there.
Sometimes the linked duplicate isn't the best choice. You can help by finding and promoting a better choice - on the meta site and in the chat rooms. You can also help by editing common duplicate targets - both questions and answers - so that it becomes more clear to people who would actually have the question, that they're in the right place (and so that the information in answers is more readily applicable to them).
[1] https://foundation.wikimedia.org/wiki/Policy:Wikimedia_Found...
If you ask a question on Stack Overflow and it gets closed, you are generally expected to edit it to fix the identified problem and submit it for re-evaluation. It gets put in a queue that other users can review; and everyone with close-vote privileges also has reopen-vote privileges, and can come along randomly and evaluate the question anew.
If you believe the community has misunderstood something about the question or has misapplied policy, you can ask about it on https://meta.stackoverflow.com . However, when you come to the meta site, you are generally expected to have a basic understanding of what the policy is and what our goals are (hint: not helping you, personally, make your code work), and to accept that you may have misunderstood something. And you should be prepared for the fact that voting works differently on meta (https://stackoverflow.com/help/whats-meta).
People who vote to close your question (or downvote it) are explicitly not required to explain this (again for well considered reasons, largely around the risk of harassment or abuse: https://meta.stackoverflow.com/questions/357436). But usually, if the standard close-reason advice won't be obvious, someone will try to explain. If they think the question is unclear, they'll try to say specifically why they are confused; if it seems to lack focus, they'll highlight the separate problems you're asking about or explain what seems irrelevant; if it "needs debugging details" then they'll explain how your code sample falls short of the https://stackoverflow.com/help/minimal-reproducible-example standard.
If you need an explanation and don't get one, you can again ask on meta. Despite the downvoting, if you're polite and understanding (i.e. don't come in with the mindset that we must have made a mistake or are doing something wrong by having a site that works differently from other sites), we'll be polite and sympathetic, and try to explain as best we can.
The original idea of SO was building a knowledge repository, and that meant no duplication and pruning it endlessly to make sure it was useful and up to date (which pretty much failed until recently, until its probably far too late) - this core tenet is something the moderators take seriously, and people using the site as questioners (not searchers) absolutely hate.
You can see they are trying to experiment (again probably too late) with how to make question asking easier, more friendly, etc - but that sort of cuts against the core original goals of SO and that's why the mods and the users seemed to be always in tension.
This is not true as I recall. On Joel and Jeff's podcast, Joel in particular was in favour of having lots of variants of the same question answered repeatedly. His rationale was that if people didn't find the golden original question, there was a reason for that (e.g. it's not a real duplicate, or it's a different frame of thinking about the problem shared by other people), and adding the supposed duplicate would mean that other people who search for it - and would similarly fail to find the golden original - would land on the supposed duplicate. Net win.
But this was in tension with cheap karma farmers. SO was structured as a points economy, but in any case anything with points rewards motivates some people to play the game of collecting points. A cheap way of farming points is to ask trivial questions then answer them yourself, or participate in an implicit network of people asking and answering trivial questions. How do you cut that out? Have canonical versions of the trivial questions, redirect people to them while asking, and motivate deduplication.
As I said, I strongly disagree with the idea that my questions were unfit for StackOverflow. Every single time their reason was "duplication", it was not AT ALL a duplicate. Two different questions (sometimes obviously very different) with two different answers. Hell, they closed some of those as duplicate even though I posted both the question and the answer, and the answer was completely different from the one they were pointing to.
This is not "I want to ask whatever questions I want". It's bad moderation.
If the moderation was effective and limited, people would ultimately be fine with it.
What people don't like is having a question closed as "duplicate" even though what it supposedly duplicates is very different, or any of the other myriad complaints.
The same story goes for Wikipedia. Moderators have an agenda, act in frequently erroneous ways, and are actively hostile to criticism.
1) People want to ask homework questions (_eg_ on Biology, Chemistry, etc). I understand why that is not allowed, but that doesn't change people's desire to 'just have an answer, now!'. I guess that AI could really take over this niche.
2) Others want to ask very open-ended 'discussion' questions that require back-and-forth to get to the answer, which may be on the edge of known research.
While I do understand why people get frustrated about these things, as you point out - this is not what SO (and SEs) are 'for'.
Super moderators are elected, but not your regular "moderators". In stack overflow, regular folks you have enough karma are moderators and can cast votes, or initiate voting on moderation action. Enough votes and the action happens.
The elected moderators aren't the problem, generally, it's that anyone with a bit of karma can go power tripping and if you get enough of those people on an ever growing platform, they reach a critical mass to stifle anything.
So yes, some moderators are elected, and yes moderation is very democratic.
The overwhelming majority of the actions people complain about in this context (never mind that they don't understand the purpose of those actions or the underlying objectives) are not performed by moderators. They are curation actions taken by members of the community.
The rights to do so are awarded based on reputation, in a very poorly thought out and fundamentally broken incentive system; but there are far more people involved than the moderators. You can query by reputation at https://data.stackexchange.com/stackoverflow/query/1834631/c... : there are about 29 million total user accounts, 3.3 million which may upvote, 1.1 million which may downvote, 150 thousand which may unilaterally edit posts, 100 thousand which may vote to close questions, 28 thousand which may vote to soft-delete posts (and view soft-deleted posts), 9300 with access to internal site analytics...
and twenty-four moderators (https://stackoverflow.com/users?tab=moderators). Who are not the highest-reputation users. (I have more reputation than over half of them, and I frequently complain about users with over ten times my reputation.)
A community which has, according to the tons of comments here, become toxic.
What if moderators had to actually have karma from recently answering questions or they lose mod privileges?
Wouldn't that be a fresh change. You'd have to actually work to be a mod.
...
It shouldn't be controversial. That mods currently make visitors unwelcome is disgrace. :(
That SO incentivizes that behavior is ridiculous.
Why spend your own time and effort adding content to someone else's platform anyway? It's always a much better idea to write an article on your own website than a stackoverflow answer. Stackoverflow just takes a little less effort but that doesn't matter when your effort is likely to be invalidated anyway.
Good. That's the site working as designed and intended.
> What was becoming more common was that I would have a question similar to an existing unanswered one.
Then you should improve the existing unanswered question instead, and/or draw attention to it (https://meta.stackoverflow.com/questions/265874 ; https://meta.stackoverflow.com/questions/266338). Or, yes, answer it if you can. Thank you for doing so.
> Or that my question would never receive an answer (presumably because my questions were becoming more tricky/niche).
That's a big presumption. I got an answer to https://stackoverflow.com/questions/75677825/ within hours.
> for some reason, a few years ago my questions started being closed for no apparent reason other than "those who reviewed it have no clue and think that it is invalid"
This is absolutely not what happened. First off, when your question is closed, you get a banner at the top of your question indicating which of the few standard close reasons was chosen. The wording isn't always a great fit (especially in the cases where people voted for more than one close reason - please keep in mind that we neither write this explanation nor get to choose the text; it's pulled from a database following simple mapping rules, and even moderators have only very indirect influence over that database) but it does normally point you in the right direction.
Second, "I don't know the answer" is not a valid close reason. People constantly accuse (on the meta site and elsewhere) that someone else's close vote was motivated by this; there's never any real way to evidence that, and this kind of accusation is in fact what we consider toxic behaviour (an assumption of bad faith).
> Many times they closed even though I had posted both the question and the answer at the same time (as a way to help others)!
The fact that you provide your own answer weighs exactly zero in the calculation of closing a question. It must meet the site standards. Part of the purpose of a question is to index the information in the answer - so no matter how brilliant your explanation of the underlying problem might be, your exposition of the problem is a limiting factor.
> The first few times, I fought to get my question reopened and guess what? They all got a few tens of votes in the following year.
The community does make mistakes, in both directions. The meta site exists for a reason.
But part of "fighting to get a question reopened" is editing it. Changes you might think are trivial might be crucial according to our standards. Some questions fundamentally can't be fixed; but when they can, closing a question signals that the OP's perspective is needed to fix the problem, no matter how minor. If we could fix it (without worrying about trampling on your authorial intent), we would.
>Still, that toxic moderation hasn't changed. If anything, it has gotten worse.
It's not moderation, but curation. It's overwhelmingly done by a community of volunteers - not by the two dozen or so moderators (also volunteers) looking over an accumulation of literally millions of users and questions.
And it isn't "toxic". Overwhelmingly, people aren't doing it out of any kind of vendetta or a desire to cause you or anyone else a problem. They're doing it to uphold a standard (https://meta.stackoverflow.com/questions/417476/) designed (really, developed over many years by community discussion on the meta site) to accomplish particular goals (https://stackoverflow.com/tour ; https://meta.stackoverflow.com/questions/254770).
> I am usually better off opening an issue or discussion directly with the upstream project
If it's something that makes sense to handle this way, it probably doesn't also make sense in the Q&A format. We can't do anything about your bug report.
> I heard people mentioning that LLMs were hurting StackOverflow badly.
A lot of people think so because the volume of questions has dropped off dramatically, and there's good evidence that people will ask an LLM instead of asking on Stack Overflow.
But this is not at all "hurting Stack Overflow", unless you're a staff member at the company and you specifically worry about the effect of this decline on ad revenue.
If asking an LLM - trained on millions of existing Stack Overflow questions, along with the rest of the Internet - gives you an actually working answer (and you're either in a position where you can deal with AI hallucinations, or are lucky enough not to experience one), then that is, almost certainly, not a question that helps improve the existing resource that is Stack Overflow. It's most likely a duplicate or near-duplicate.
Duplicate questions on Stack Overflow are not inherently bad; sometimes rephrasing a question helps by providing a "signpost" so that people who think about a problem in a different way can realize that it's still the same problem, and there's still the same fundamental question to answer about it. But we want everyone who has that question to find the same collection of answers; and we want that collection of answers to be high quality, not redundant, and categorized under a high quality version of the question. That way, when you use a search engine and find Stack Overflow Q&A, you get the best possible result, as quickly as possible.
Nowadays, there are about three times as many publicly available questions on Stack Overflow as there are articles on Wikipedia. Considering that the scope of Stack Overflow is "practical questions about programming", while the scope of Wikipedia is "literally any noteworthy real-world object or phenomenon", that's clearly too many already. So why worry about the influx of new questions slowing down?
If it is from 2010 and was a relevant question or answer then but has since become irrelevant or even wrong because the framework or language has moved on I actually support this kind of clean up.
There are a lot of best practices that just don't apply anymore that far down the line. Even simple things like whats the best way to use a variable inside of a string in Python would have an outdated (and to most users, wrong) answer if it was from 2010.
I don't understand the idea. Are you also in favour of deleting blog posts that are older than a couple years? There is a date next to the question...
In retrospect it is a case study of a particular enshittification scenario: "benign neglect" Back when they published a data dump I had a project on my speculative list to clean up their database, take only the best answers, etc. For python, the numerous Python 2 examples
print "something"
would get rewritten to Python 3 print("something")
basically do the maintenance work they weren't doing. Personally I find their idea of what is a valid question to ask offensive. If you're coding in Java or Javascript for example, the question of "Guava vs. Spring" or "Vue vs. React" are probably more consequential decisions for your app as opposed to anything else but questions like that are forbidden.Over time we found that hardly anyone asking questions could achieve the kind of "good subjectivity" that we wanted. Questions like this attract flame wars (which are especially obnoxious in a format with answer posts with non-threaded comments) and advertising for alternatives, add-ons etc. that result in a completely derailed discussion in a place that isn't supposed to have a discussion at all.
If you want to ask "what factors should I take into consideration when choosing..." then I would agree that can in principle fit on a Q&A site. But open-endedness again makes it hard to choose the best answers and ensure they float to the top.
The general principles are much the same at Codidact Software (https://software.codidact.com), but the scope is considerably wider than Stack Overflow's (https://software.codidact.com/posts/search?search=category%3...). You might have better luck with that kind of question there.
*Later he took over the Flask project and I was still bitter so I stopped using that too.
Another old problem was notable users. There was a guy famous for his presence and answering tons of question (I forgot his name). He was actually pretty good but... he was not an expert in all the areas he'd participate in, but his answers would sometimes win because he was articulate, not because it was the best.
https://openai.com/index/api-partnership-with-stack-overflow...
Which is also the reason for the ban on GenAI content (https://meta.stackoverflow.com/questions/421831).
I guess nobody could disagree, that it benefits all if the site is useful and whether the content is factually correct and up-to-date and follows Q&A format.
I admit, I haven't followed what happens closely for some time, but here is some older example post: https://meta.stackexchange.com/questions/389834/statement-fr...
https://learn.microsoft.com/en-us/dotnet/api/system.servicem...
https://learn.microsoft.com/en-us/dotnet/api/system.servicem...
Could you use these to cancel the stream?
public class StreamingService : IStreamingService { private readonly ILogger<StreamingService> _logger;
public StreamingService(ILogger<StreamingService> logger)
{
_logger = logger;
}
public Stream GetRandomStream()
{
var random = Random.Shared;
var isClientConnected = true;
var context = OperationContext.Current;
context.InstanceContext.Closed += (s, e) =>
{
_logger.LogInformation("Client closed connection.");
isClientConnected = false;
};
context.InstanceContext.Faulted += (s, e) =>
{
_logger.LogWarning("Client connection faulted.");
isClientConnected = false;
};
return new MonitorableRandomStream(random, () => isClientConnected, _logger);
}
}public class MonitorableRandomStream : Stream { private readonly Random _random; private readonly Func<bool> _isClientConnected; private readonly ILogger _logger; private long _sequence;
public MonitorableRandomStream(Random random, Func<bool> isClientConnected, ILogger logger)
{
_random = random;
_isClientConnected = isClientConnected;
_logger = logger;
}
public override bool CanRead => true;
public override bool CanSeek => false;
public override bool CanWrite => false;
public override long Length => throw new NotSupportedException();
public override long Position { get => _sequence; set => throw new NotSupportedException(); }
public override void Flush() {}
public override int Read(byte[] buffer, int offset, int count)
{
if (!_isClientConnected())
{
_logger.LogInformation("Stopping stream: client disconnected.");
return 0;
}
var span = new Span<byte>(buffer, offset, count);
_random.NextBytes(span);
_sequence += count;
return count;
}
public override int Read(Span<byte> buffer)
{
if (!_isClientConnected())
{
_logger.LogInformation("Stopping stream: client disconnected.");
return 0;
}
_random.NextBytes(buffer);
_sequence += buffer.Length;
return buffer.Length;
}
public override long Seek(long offset, SeekOrigin origin) => throw new NotSupportedException();
public override void SetLength(long value) => throw new NotSupportedException();
public override void Write(byte[] buffer, int offset, int count) => throw new NotSupportedException();
}Is there some kind of `IClosableStream` you can implement? That’d give you a `Closed` method, which you can then use to let either your server or stream know that it’s time to stop reading (or the stream reached EOF) - even if it’s done with a flag that’s set when the client disconnects.
Maybe there’s already an optional `Close` method you’re not overriding?
On the client side, randomStream.Close will get called when it's disposed.
On the server side, I'm not sure what I could put into an overriden Close that wouldn't just be base.Close()? RandomStream itself doesn't own any resources that need cleaning up.
I could force WCF to use Session mode, and then add flow-control through a side-channel, so other messages could prepare the stream to internally buffer and then rewrite in requested chunks?
But at that point I might as well just use an apprpriately sized GetRandomBlock(ValueWithSequence[]), and chunk requests that way and abandon using a stream for this at all.
I'll have an experiment with that approach to try to find the best buffer size and whether streaming the buffer actually helps vs just having it as the message and letting WCF control the sending.
It's weird behaviour and I wouldn't have expected it either, since infinite length streams are pretty common.
There'd be some bookkeeping to keep track of the stream (so you can set its flag) then replace it with a new one the next time a client connects, effectively making each stream single-use. But you seem to be optimizing for rate of reads, not number of opens and closes you can do, so it seems that shouldn't be a blocker..
Ask a question.
Ignore the trolls.
Get a question answered that would have taken you another day to solve.
Make money.
I barely use it anymore. GitHub issues are far more useful these days but lacks a place to ask generic questions.
GitHub could strike a knockout blow here if they wanted to.
Interesting point. I'm going to see if they similarly struggle generating VBA code vs generating Visual Basic code.
I posted this iOS Swift Programming question today:
https://stackoverflow.com/questions/79612931/ios-custom-oper...
and was instantly downvoted and then voted to closed. I do not think this question was worth downvoting or closing. There's no hits on the warning I was getting.
People on SO nowadays seem way too eager to downvote and close.
The outstanding vote to close is on the grounds of "needs details or clarity". Based on the comment that was left, I assume that the other party doesn't understand why you are asking a question, because it comes across that your motivation for asking is that you don't understand what to do, but it also comes across that the error message is already telling you exactly what to do.
If you have a different question - for example, why you should have to do the thing being suggested, or you don't understand how to do the thing being described - then you should edit the question to clarify that. With this clarification, it may be that your question is identified as a duplicate (of a more general question regarding why such "inherited conformance" must be restated in Swift, or what that means, etc.). I don't know Swift, so I can't advise there - I can only rely on my general understanding of programming languages in this general syntax family.
Regardless, the question would be improved by a proper minimal reproducible example (https://stackoverflow.com/help/minimal-reproducible-example). Minimal is a key component of this; please proactively try to remove irrelevant parts of the code example, so that you show only what directly causes the reported problem. This helps (https://meta.stackoverflow.com/questions/333952) other people understand and recognize the question - not just people who might answer it, but other people who have the same question who are looking for an existing Q&A.
> There's no hits on the warning I was getting.
I guess you mean that you tried searching for the warning and came up empty handed. I'm not sure why this happened for you. If I try copying and pasting into a search engine - e.g. https://duckduckgo.com/?q=Class+must+restate+inherited+%27Cl... - I get seemingly useful results off the top - including issues in the GitHub repository for Swift itself, such as one proposing and automatic "fix-it" for this error (I assume this concept is meaningful to Swift developers generally). I also see official Apple documentation at https://developer.apple.com/documentation/swift/sendable , several blog posts talking about the use of `@unchecked Sendable` with fully worked examples, etc.
> I do not think this question was worth downvoting or closing. People on SO nowadays seem way too eager to downvote and close.
Nobody ever thinks their own questions are worth downvoting or closure - they wouldn't ask if they did. But the standards aren't set by the OP; they're set by policy and surrounding discussion such as https://meta.stackoverflow.com/questions/417476 and https://meta.stackoverflow.com/questions/252677 and https://stackoverflow.com/help/closed-questions and https://stackoverflow.com/help/why-vote and https://meta.stackoverflow.com/questions/429808. And they're set this way because the site isn't about answering your question in the moment; it's about building up a searchable, useful repository of high quality questions and answers.
https://community.revenuecat.com/sdks-51/many-rc-related-war...
However, when I searched for it now (after seeing you were getting that Swift GitHub result), I got better results. No idea why I didn't get that before.
Thanks for the detailed answer. I appreciate it.
The right place for this kind of question is the GitHub Issue tracker for CoreWCF, where you'll find several related issues. You're not the first one to hit bugs in streaming mode, which is... fragile. Just turning HTTPS on or off can break it: https://github.com/CoreWCF/CoreWCF/issues/1391
Unbounded streaming is something WCF was not designed to support, and hence CoreWCF doesn't support it either. CancellationTokens, etc... might improve things in case of accidental disconnection of a client session, but in general WCF expects streamed responses to have a finite length and be explicitly terminated with an end-of-stream by the server.
E.g.: read the end of this section: https://learn.microsoft.com/en-us/dotnet/framework/wcf/featu...
"Streamed transfers end and the message is closed when the stream reaches the end of file (EOF). When sending a message (returning a value or invoking an operation), you can pass a FileStream and the WCF infrastructure subsequently pulls all the data from that stream until the stream has been completely read and reached EOF."
Fundamentally, WCF is a message-oriented RPC system. It has many issues with streaming: it has to be explicitly enabled, it is incompatible with many features, etc...
Just "read between the lines" in your stack trace! It mentions XML encoding in several places, but XML as used in RPC uses a "tree" structure which must be terminated with closing tags.
You might be able to shoehorn unbounded streams into CoreWCF by implementing custom channels and encodings, but at that point it isn't really WCF any more!
The bug is that CoreWCF really should give up and stop writing if the client is disconnected. Stepping through its code, it does look like it loses track of the CancellationToken at some point, probably riiiight here: https://github.com/CoreWCF/CoreWCF/blob/067f83b490332120f45e...
Note the comments surrounding it talking about things like "TODO: Verify that the cancellation token is honored for timeout" and "Since HTTP streams don't support timeouts, we can't just use TimeoutStream here." That sounds unfinished to me.
I can't be sure, but there seem to be some design flaws that also contribute to this bug. E.g.: CoreWCF uses synchronous writes to ASP.NET Core's pipeline, which is... also a buggy mess because it is so rarely used.
Then, somehow, it is still writing to a socket that is long gone, which is really odd. It really does feel like there's at least a DoS security bug here, either in ASP.NET when operating in sync mode or in CoreWCF. The issue is that malicious clients could easily request many large responses, disconnect, and the server would keep processing the requests for hours and hours.
The more I looked into the issue, the more it felt like I was trying to do something WCF isn't designed to do.
My experience with Microsoft-related stuff now being done "in the open" on GitHub has been great, because it means that users like us can directly open an issue ticket right where the developers are day-to-day. The tickets get attention and/or fixes more more often than screaming into the void on some generic forum full of only vaguely interested people.
Seems like an issue with not closing resources properly. Looking at your server code, seems the Close and Dispose methods are not overridden. Try that?
It'll be calling base.Close(), and doing what else?
SO is trash now-a-days.
Now at 200k+ rep I cannot stand it anymore. Whenever I ask a question that does not make me bow backwards or discuss how my Python code looks in assembly it gets downvoted almost immediately. Go and Typescript are tags that being frustration.
Now compare this with many other Stack Exchange sites.
A question about cooking or LaTeX gets nice, coloriant answers, even when they are basic.
I get it that they are one or two orders of magnitude less crowded but this may mean that SO passed its scale limit and is done.
(although I have no idea how active CoreWCF owners are w.r.t this)
This might also be a problem WCF client, which is maintained by others elsewhere in a different repo: https://github.com/dotnet/wcf for the nuget package version.
But this might just be how WCF is designed. I'll try a version of this within .NET Framework, but even that might change depending on whether it's via IIS or started via ASP.NET Core, and whether it uses the built in System.ServiceModel or the nuget version.
( You can probably tell I'm a bit frustrated with MS for making a bit of a mess in the way they hurried away from .NET Framework especially with respect to WCF. )
It may not be necessarily a problem but, ideally, the less users have to care about gotchas and knowing how to exactly use the API the better. There are some constraints to this but chances are at least documentation can be improved.
Plus, especially if there are not that many issues, it signals interest and active usage.
Just for the sake of it, I've now tried pasting this whole blog into claude.
It has some strange suggestions, including many things that don't work, such as adding to the client:
// Important: Properly close the stream
randomStream.Close();
I read the Stream documentation ( https://learn.microsoft.com/en-us/dotnet/api/system.io.strea... ), and it points out:> This method calls Dispose, specifying true to release all resources. You do not have to specifically call the Close method. Instead, ensure that every Stream object is properly disposed.
My stream is properly disposed.
Claude also sticks in things like:
// Simulate some work or add a small delay to prevent CPU spinning
Thread.Sleep(1);
I can't see how that do anything to solve my issue. I suppose I should humour the machine, go full-vibe and try everything it suggests, and if I end up with a working solution go back from there, but I fear that would just leave me more confused about the underlying mechanisms here.On the client side it not only rewrites my reading to read multiple times, but adds in:
await Task.Delay(500, cts.Token); // Small delay between reads
I didn't ask it to re-introduce the loop, and a 500ms delay between reads is horribly long for reading successive bytes from a stream.The only thing that was interesting was creaitng a linked cancellation token source on the service to pass to the underlying stream and cancelling it on server shutdown.
That's a useful thing to keep in mind to help with helping to shutdown the services, but doesn't actually address the issue for a server you want to keep running.
It does also add send/receive timeouts too, and they're also worth keeping in mind, but that doesn't seem like a good mechanism for dealing with this issue. If anything, it would just mask the issue by having it write to the stream for the duration of the timeout period instead, which if short could cause a problem like this to go unnoticed until it's actually under more load.