Depends on D3487
https://linear.app/comm/issue/ENG-905/fix-the-threading-problem - the problem and approaches are described in the task
Differential D3488
[services] Backup - make blob client instances separate for every thread • karol on Mar 22 2022, 2:47 AM. Authored by Tags None Referenced Files
Subscribers
Details Depends on D3487 https://linear.app/comm/issue/ENG-905/fix-the-threading-problem - the problem and approaches are described in the task You need 3 terminals cd services yarn run-backup-service 2: cd services yarn run-blob-service 3: ./build.sh ./cmake/build/bin/client then in the GUI use the n option (just type n and hit enter, this stands for creating a new backup).
Diff Detail
Event TimelineThere are a very large number of changes, so older changes are hidden. Show Older Changes
Comment Actions Could you explain why do we need to use this synchronization? Is there a way to avoid the synchronization? What are the consequences of using synchronization for handleRequest method? Can we handle a couple of connections at the same time? edit: Comment Actions Before analyzing if this code handles synchronization correctly, I'd like to check if it is really the best option. In the task you described a possible solution:
Is it possible to fix the main problem by postponing object deletion until the communication is done, e.g. by replacing delete this with setting a callback in which the object is deleted and giving that callback to the other reactor? Overall, it's not obvious for me why do we need complicated synchronization here. Comment Actions
The solution you proposed seems to be very hacky. First, delete this lies in the base reactor's code. Second, I don't understand what is "other reactor" here? Did you mean putReactor?
Not sure what is unclear here. We have a server reactor that creates a client reactor inside. We need to wait for the client reactor to complete all operations before we terminate the (parent) server reactor.
Comment Actions We've discussed this offline with @karol-bisztyga. It looks like the main issue is that we need to call one reactor from another, but in our current solution when the caller is done it deletes itself which results in callee being deleted before it can finish its work. We've considered a couple of other options not involving using mutexes, one of them is promising, but it needs to be verified. Even if we agree to change the approach, there are a lot of diffs in this stack so it will be a lot cheaper to do such change in a followup. Requesting changes because of inline comments, but we will probably keep the overall approach for now.
Comment Actions Accepting, but please create a task where we can discuss about the alternatives.
Comment Actions
Comment Actions Ok, I'm landing this now, @palys-swm if you feel like something here is unfinished, please let me know. |