11 ms·
My stackoverflow question was closed so here's a blog post about CoreWCF
- eterm 1y agoA post in which I try to rubber-duck a CoreWCF issue I've been having, because stackoverflow no longer seems suitable for asking questions about programming issues. 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-in-corewcf-after-streaming 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.
- agos 1y agofor what it's worth, I submitted the question as a candidate for reopening
- matsemann 1y agoHonestly, I agree with it not being a good fit for a Q&A site. It's a debugging problem, probably needing a discussion, and might even not be of any use to others being that "high cpu" is kinda vague. Seems better suited for a bug report / issue tracker of the relevant library.
- jve 1y agoA community site for multiplayer debugging... I like it! Some people like to tackle problems and feel rewarded when they crack the nut :)
- eterm 1y agoYour'e right, "High CPU" just means more than zero. It was a symptom of the stream continuing to be written to. I've edited the title now to be better.
- wokwokwok 1y agoHow can a question that is: 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.
- robertlagrant 1y ago> 2) reproducible Is it? What hardware and OS version should I use to reproduce the server?
- Const-me 1y agoAlmost any hardware, .NET runs on x86, AMD64, ARMv7 and ARM64 processors. Almost any desktop or server OS, .NET runs on reasonably modern versions of Windows, Linux and MacOS. The complete source code of the server is in the question.
- robertlagrant 1y ago> .NET runs on x86, AMD64, ARMv7 and ARM64 processors. Almost any desktop or server OS, .NET runs on reasonably modern versions of Windows, Linux and MacOS. I'm not really asking where .NET runs; I'm asking what is the environment to reproduce it in? If it only affects certain ones it's a waste of time to just make people guess. > The complete source code of the server is in the question. Yes, I saw.
- Const-me 1y agoThe .NET runtime is cross-platform, the lower level asp-net infrastructure is included in the runtime. The higher level CoreWCF RPC library OP uses is written fully in C#. I would expect it to run in all environments supported by the .NET runtime. Personally, I have reproduced the bug on Windows 10 running on AMD64 processor. BTW, the code in the question only communicates to localhost address i.e. doesn’t need any networking on the computer.
- francisofascii 1y agoI could see it being useful to others. If there is an internal bug that causes the issue or even a code pitfall that causes this issue.
- kristianp 1y agoStackoverflow is basically a site to help people with programming problems. That includes debugging a problem. I think it's sad that many types of question are not considered suitable for the site. The question was closed as "Not suitable for this site", whatever that means. 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.
- balls187 1y agoI don't see anything wrong with your SO question (I am a long time contributor), and don't see why it would have been closed. 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?
- rendaw 1y agoDo they have some metric whereby all questions must be answered in some time period? Why not just leave it open then? What if someone else has the same question and figures it out later, now they can't answer it either! I had the same suspicion though, which is that if the question is too difficult it triggers some reflex...
- skinkestek 1y ago> I will say, this is a level of question that is too sophisticated for SO 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.
- robertlagrant 1y ago> Please feel free to point out more ways in which I screwed up asking my SO question. With pleasure! SO is definitely more of a distinct Q&A site and not a discursive, open-ended collaborate and problem-solve site.
- zahlman 1y agoI fully expect nobody in this comment section to care about the CoreWCF content. (I don't even know offhand what that is.) In my experience, people love talking about Stack Overflow in places that are about programming but aren't Stack Overflow, so. (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 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 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 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 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 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 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 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 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 https://meta.stackoverflow.com/questions/417476) as quickly as possible (https://meta.stackoverflow.com/questions/260263 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 https://meta.stackoverflow.com/questions/271684 is over 10 years old; and the original complaint https://meta.stackexchange.com/questions/9731 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 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.)
- npodbielski 1y agoHey mate is it your post? I did glanced at it and it does not stop because server is not notified that client is not there. 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.
- treebeard901 1y agoYeah the stream isnt being closed properly as it is likely still trying to fill a buffer that no longer exists. The CancellationToken is a good idea regardless because you know once youve written the result, that you no longer need to wait for results. Using has similar problems with things like database connections remaining open.
- the_clarence 1y agoThe same has happened on reddit a long time ago. Most users give up early because they get their forst posts (on any community) removed many times before they can manage (if they do manage) to post it. If the feedback loop was faster (you instantly get feedback on why the post doesn't go through) it would be better although you would already lose some users. The situation is so bad that I predict reddit is slowly dying already
- ryandrake 1y agoAs a general rule, I'm not going to take the time to donate free content to a site where moderators just delete it. This goes for S.O., Wikipedia, Reddit, Social Media, OSM, even HN. If my posts ever start getting flag-killed here, I'm not going to complain--I'm just going to leave, assuming the feelings are mutual. I used to habitually post to Fark.com, and when their moderators started going out of control and deleting my (and others') posts, I just canceled my subscription and went away. Who needs that grief? 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.
- socalgal2 1y agothis will no longer happen because everyone has learned to just ask the LLM who will just answer. No need for reddit or S.O. for tech questions
- rendaw 1y agoJust anecdoting, a couple weeks ago I asked my first question about the definition of `width` in CSS and how it pertains to minimum size calculations. 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.
- prinny_ 1y agoI have stopped asking questions there. The moderation is so heavy handed it astonished me. I asked a question about some typescript types of an external library, the very author of those types replied and answered my question and I replied that I was happy with his answer and to thank him for his work on the library. The mods deleted my reply. 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.
- Const-me 1y agoNot sure it’s the main issue, but your infinite random stream implementation is broken due to integer overflow. Stream.Position is using int64 for a reason, but your _sequence field is int32 which wraps after 2GB. BTW C# compiler has a setting to convert arithmetic overflows into runtime exceptions, too bad Microsoft neglected to enable by default.
- throwaway2037 1y agoI upvoted your SO.com question Can you put a bounty on it? That will help.
- palata 1y agoI used to be very active on StackOverflow, it was a great platform. 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.
- esafak 1y agoThe moderators were elected. What should StackOverflow have done, held a vote of no confidence? Given them less power; make moderation more democratic?
- agos 1y agomaybe set different guidelines for moderation? have some form of meta moderation?
- hobs 1y agoThe core problem of SO was the the goal of it (and what made it great) is very much in tension with "I want to ask whatever questions I want." 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.
- cadamsdotcom 1y agoLooks like the framework is just going to keep reading to the end of the random number stream, but of course there isnt an end to it. 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?
- __s 1y agoStupid idea: throttle stream by putting Sleep in Read
- eterm 1y agoThanks for trying to help. 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.
- cadamsdotcom 1y agoWhat if your Close implementation sets a flag in the stream that, if set to true, causes it to respond to Read calls with an EOF? 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..
- wzdd 1y ago
- yakz 1y agoThere are some events you can handle: https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.icommunicationobject.closed https://learn.microsoft.com/en-us/dotnet/api/system.servicem... https://learn.microsoft.com/en-us/dotnet/api/system.servicemodel.icommunicationobject.faulted https://learn.microsoft.com/en-us/dotnet/api/system.servicem... Could you use these to cancel the stream?
- junto 1y agoThis is the route I would go too, but quite honestly once you’re using the more non-standard WCF bindings in CoreWCF, you’re kind of playing with fire anyway. Microsoft never really intended to support WCF and SOAP in Core since it relied on so much Windows API’s under the hood in .NET Framework and they only added some support behind CoreWCF because so many enterprise customers still had SOAP and .NET services flying about that they had pressure to support something in this area. 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(); }
- jgalt212 1y ago> This is confusing enough for humans, let alone a machine that will happily reproduce calls and configuration from something that is almost identical, yet subtly different and incompatible. Interesting point. I'm going to see if they similarly struggle generating VBA code vs generating Visual Basic code.
- phkahler 1y agoStackoverflow is no longer a Q&A site. It's trying to become a curated information source. Like wikipedia or the kind of thing you'd train AI with. As such it isn't great for answering question any more. 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.
- nicce 1y agoLikely this summarises the shift: https://openai.com/index/api-partnership-with-stack-overflow/ https://openai.com/index/api-partnership-with-stack-overflow...
- zahlman 1y agoOn the contrary, the people trying to keep the site a useful, curated source of information (rather than a dumping ground for people trying to get others to debug code for them) are on balance strongly against every kind of AI involvement with the site, including the use of that information for training AI (although we can't do anything about that). We curate a repository of high quality questions and answer (which is a "Q&A site", and is specifically what the site is supposed to be, so as to distinguish it from traditional forums) exactly because we want it to be a place where you get information from humans that reflects original human insight. Which is also the reason for the ban on GenAI content (https://meta.stackoverflow.com/questions/421831 https://meta.stackoverflow.com/questions/421831).
- nicce 1y agoThe primary question is that who is deciding that what kind of information is curated and whether the arguments have been properly voted, and the process itself is transparent. 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-from-so-june-5-2023-moderator-action https://meta.stackexchange.com/questions/389834/statement-fr...
- neonsunset 1y agoIf the author reads HN comments - findings like these are probably better to be submitted at https://github.com/CoreWCF/CoreWCF https://github.com/CoreWCF/CoreWCF instead (although I have no idea how active CoreWCF owners are w.r.t this)
- shagie 1y ago... and https://github.com/CoreWCF/CoreWCF/discussions https://github.com/CoreWCF/CoreWCF/discussions
- eterm 1y agoThanks. In my experience the CoreWCF team are fairly active, but I didn't want to bother them until I can understand if this is a problem with CoreWCF. This might also be a problem WCF client, which is maintained by others elsewhere in a different repo: https://github.com/dotnet/wcf 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. )
- neonsunset 1y ago> Thanks. In my experience the CoreWCF team are fairly active, but I didn't want to bother them until I can understand if this is a problem with CoreWCF. 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.
- xyst 1y agoC# is not my primary language but have the misfortune of debugging C#/.Net junk. 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?
- eterm 1y agoWhat resources do you think should or could be handled in an overriden close method on RandomService? It'll be calling base.Close(), and doing what else?
- incoming1211 1y ago"I dont know C# but ill make a bold assumption"
- bitbasher 1y agoI'm curious-- did you feed this into an LLM to see what it thinks the issue is?
- eterm 1y agoI didn't, but I've not had much previous success with these kinds of issues. 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.stream.close?view=net-9.0 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.
- zahlman 1y agoAll of that is very much in line with what I'd expect Claude to suggest - because it's exactly what I'd expect to see on the garbage blogs that LLMs trained off of, in turn oriented towards fixing common problems from people who don't know what they're doing.
- hakunin 1y agoMy most recent (nearly 3 years ago) StackOverflow story: 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 https://stackoverflow.com/q/73954228/155351 [2]: https://notes.max.engineer/creating-common-interfaces-in-golang https://notes.max.engineer/creating-common-interfaces-in-gol...
- ayhanfuat 1y agoThat user was using AI to autogenerate answers. Most of his answers posted in a certain period were deleted in bulk. If you think this was not something AI generated then you can raise a flag for it to be undeleted https://meta.stackoverflow.com/q/430072 https://meta.stackoverflow.com/q/430072
- hakunin 1y agoYeah, looking at it today I do smell the AI. Nearly 2.5 years ago I had no experience to suspect it. I'm less annoyed with it getting deleted now, but it was still a useful and relevant explanation at the time.
- zahlman 1y agoFor reference: almost all deletion on Stack Overflow is "soft", and deleted Q&A can be viewed by users with at least 10,000 reputation. These users can vote for undeletion, and the author can edit and submit for undeletion. 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/ 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.)
- BrandoElFollito 1y agoI opened my SO account 15 years ago and I was liking the dynamics very much. 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.
- busymom0 1y agoI have been an SO user for 13 years with around 9k karma. I have recently started having similar negative experiences. I posted this iOS Swift Programming question today: https://stackoverflow.com/questions/79612931/ios-custom-operation-for-operation-queue-gives-warning-class-must-restate-inheri 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.
- zahlman 1y ago> and was instantly downvoted and then voted to closed. 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 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 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+%27Class+must+restate+inherited+%27%40unchecked+Sendable%27+conformance%27+conformance 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 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 https://meta.stackoverflow.com/questions/417476 and https://meta.stackoverflow.com/questions/252677 https://meta.stackoverflow.com/questions/252677 and https://stackoverflow.com/help/closed-questions https://stackoverflow.com/help/closed-questions and https://stackoverflow.com/help/why-vote https://stackoverflow.com/help/why-vote and https://meta.stackoverflow.com/questions/429808 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.
- eYrKEC2 1y agoStack Overflow is like online gaming -- lots of toxic people, but I still get value out of it. Ask a question. Ignore the trolls. Get a question answered that would have taken you another day to solve. Make money.
- digianarchist 1y agoBack in the day, some of the most toxic people were community moderators. 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.
- xeromal 1y agoCan't do that if they delete the post before it gets answered
- dkackman11 1y agoSO community def not reading the room
- incoming1211 1y agoStackOverflows days are numbered, the site isn't like it used to be, it used to be useful, but over time people spend more time trying to game the system or enforce their own interpretation of rules. SO is trash now-a-days.
- bytefish 1y agoFor all reasons mentioned in the article, I wouldn’t post such a question on Stackoverflow. It doesn’t fit. And I see their reasoning. Just raise an issue in the CoreWCF issue tracker. What’s the worst thing to happen? 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.
- lakomen 1y ago[dead]
- jiggawatts 1y agoI think you found a bug, but you were doing something that was never going to work, and you reported it in the wrong place. 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 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/feature-details/large-data-and-streaming#programming-model-for-streamed-transfers 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/067f83b490332120f45ec9064dd7d1fa555ba65d/src/CoreWCF.Http/src/CoreWCF/Channels/HttpChannelHelpers.cs#L713C39-L713C56 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.
- darrylb42 1y agoThis does not appear to be support by SOAP or WCF. From the SOAP specification: "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/ 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.
- deleted 1y ago[deleted]