[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #5232 [BridgeDB]: Import bridges into BridgeDB in a separate thread and database transaction
#5232: Import bridges into BridgeDB in a separate thread and database transaction
----------------------+-----------------------------------------------------
Reporter: karsten | Owner: aagbsn
Type: defect | Status: new
Priority: major | Milestone:
Component: BridgeDB | Version:
Keywords: | Parent: #4499
Points: | Actualpoints:
----------------------+-----------------------------------------------------
Comment(by aagbsn):
After some coffee:
Bridges are placed in BridgeRings in memory; so this will be more
complicated than just a db transaction.
One possible solution could be to create a new copy of these
datastructures and then swap atomically.
It might look something like this:
(in Main.py, load())
1. create a new thread
2. create new splitter(s) and rings
3. get a db transaction
4. insert bridges
5. get a lock
6. swap the datastructures
7. commit the transaction
8. release the lock
Things to check when testing:
1. BridgeDB should serve up bridges during the update process
2. The email distributor touches the database. Make sure it works properly
during the update.
3. Additional HUPs should not deadlock.
4. Make sure that any references held by distributors are updated
properly.
Anything else I forgot?
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/5232#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs