Comments (7)
Hi @brudo thanks again for filing this. I suspect what's happening is multiple threads attempting to write to the stream concurrently, thus commingling messages. I should be able to solve this by adding a send lock of sorts to Watson TCP - followed by a NuGet update, then a NuGet update to Watson Cluster. That way, there can only be one writer to the stream at a time. I'll give it a go this weekend and keep you posted. Thanks!
from watsoncluster.
I would not have thought so since I was calling Send from inside a synchronized block, but there might not have been any delay between calls. Looking forward to your results; thanks!
from watsoncluster.
Hi @brudo I updated, committed/pushed, and published a new NuGet package v1.0.6. I added IDisposable (you wanted that on WatsonCluster) as well. I added a send lock on the client and added two new test projects: TestMultiThread and TestParallel. In TestMultiThread, multiple threads consume a single WatsonTcpClient instead. In TestParallel, multiple threads each with their own WatsonTcpClient are sending messages. In both cases, I have the server check the MD5 of the incoming message and I haven't been able to reproduce a scenario where a message is fragmented/truncated. I tried with 2, 4, 8, and 16 threads, and 4KB, 8KB, 16KB, 32KB, 64KB, and 256KB message sizes. Would you mind seeing if you run into the same issue with this update? Also if you have any feedback on additional test projects I could/should create I'd love to hear from you on it. BTW - WatsonCluster has not yet been updated, just a heads-up on that. Cheers!
from watsoncluster.
Thanks a lot @jchristn. It sounds like it is probably solved now. It may be a few days before I can test.
from watsoncluster.
My pleasure sir! I'll close this out for now, feel free to re-open if this doesn't solve it.
from watsoncluster.
Following up to confirm, I no longer see messages getting corrupted after this change. Thanks again!
from watsoncluster.
Awesome :) Thanks @brudo !!
from watsoncluster.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from watsoncluster.