-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data race fix #50
Data race fix #50
Conversation
…incrementation to be on the Main Actor thread.
Sorry for missing this PR! |
self.nextRequestId &+= 1 | ||
} | ||
return self.nextRequestId | ||
@MainActor internal func allocateRequestId() -> UInt32 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should steer away from using @MainActor
here. I'd either like another (our own) globalActor, or preferrably to wrap the value in a NIOLockedValueBox
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're unable to make that change, I can work on it sometime later
Thanks for the PR! I really appreciate the contribution |
Steering away from using
Thanks for making Citadel open. It's been really helpful. Going to use my |
Was getting a data race issue when I started importing images on multiple threads.
The error was
NIO-ELT-0-#0 (12): Assertion failed: Attempt to send request with request ID 35 already in flight.
. The code errored in SFTPClient within SendRequest on line 84 assert forself.responses.responses[requestId] == nil
.I made sure the
nextRequestId
was incremented on the main actor thread so we didn't get duplicate request IDs.