Comments (9)
A class instance of SMB2Client is not thread safe and access to it from two different threads should be synchronized.
from smblibrary.
But the exception from SMBLibrary that I reported crashes the entire app (I assume that it crashes ThreadPool or ThreadPool's thread). Maybe it's a bug in .NET runtime, idk...
Any unhandled exception in a thread started by SMBLibrary has the potential to crash the entire app. That's how .NET is designed and that's why there shouldn't be any unhandled exception in a thread started by SMBLibrary.
There was a bug in v1.5.1 that was fixed in v1.5.2, if you can show there is another issue - it will be addressed as well.
from smblibrary.
Hi,
- Please check if this happens with v1.5.2
- The client is not thread-safe.
from smblibrary.
Also, obviously there should be no unhandled exceptions on background threads, if there is such a case - it is obviously a bug that should be addressed and exceptions should be handled locally. I don't feel there is a need to handle exceptions globally as an additional precaution.
from smblibrary.
Thanks a lot for a quick response! Ok, we'll update and try to reproduce this error after that.
About thread safety - do you mean that a class instance of SmbClient2 is not thread safe? (In this case it's enough to use it as scoped dependency). Or entire parallel access to SMBLibrary is not safe? (In this case dependency lifetime doesn't take an effect and we should globally synchronize access to SmbClient2).
from smblibrary.
Also, obviously there should be no unhandled exceptions on background threads, if there is such a case - it is obviously a bug that should be addressed and exceptions should be handled locally. I don't feel there is a need to handle exceptions globally as an additional precaution.
But the exception from SMBLibrary that I reported crashes the entire app (I assume that it crashes ThreadPool or ThreadPool's thread). Maybe it's a bug in .NET runtime, idk... We use .NET 6.
I think you can easily reproduce this behavior by yourself by manually throwing any exception inside the callback: SMBLibrary.Client.SMB2Client.OnClientSocketReceive(IAsyncResult)
PS: On our side SMBLibrary methods are called from ASP.NET Core controller's handlers, so these handlers catch all exceptions and then return 500, they can't crash the app.
from smblibrary.
There was a bug in v1.5.1 that was fixed in v1.5.2
Thanks a lot! We'll check it and report you about the results.
from smblibrary.
Please open a new issue if you experience an issue with the latest version.
from smblibrary.
We couldn't reproduce this error after an updating to 1.5.3. Thanks a lot for your help!
from smblibrary.
Related Issues (20)
- SMBServer.exe HOT 1
- NullReferenceExceptions in OnClientSocketReceive and unhandeled SocketExceptions in async process HOT 15
- how can I use SMB2 upload larger file in 'ResumeFromBreakPoint' mode? HOT 4
- Copying a file while having an STATUS_SHARING_VIOLATION HOT 1
- UnobservedTaskException after Client.Disconnect() HOT 5
- SMBServer.exe HOT 1
- IsLoggedIn Getter HOT 1
- Exception thrown by .net Framework. HOT 7
- How to Access a File With in the Sub Folders Using SMB2Client
- [Question] FileSystemWatcher-like support HOT 1
- tree connect returning null HOT 1
- SMB3 client on samba server HOT 4
- Unable to access file in subdirectory HOT 1
- SMB1Client Connect method not timing out HOT 4
- UnobservedTaskException's caused by Smb2Client.Disconnect method HOT 9
- NullReferenceException crashes the application HOT 3
- STATUS_LOGON_FAILURE HOT 9
- Please make it possible to connect using SMBClients providing custom ports. HOT 3
- LargeMTU unavailable HOT 2
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 smblibrary.