-
Notifications
You must be signed in to change notification settings - Fork 221
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
base node libtor does not clean up temporary files on exit #6739
Comments
Example of root@efe92d8f38bb:/work/unzip# du -ch /tmp/.tmp*
4.0K /tmp/.tmp0ukolz
4.0K /tmp/.tmpJjoB7K/keys
12M /tmp/.tmpJjoB7K
4.0K /tmp/.tmpUdKxTx/keys
16K /tmp/.tmpUdKxTx
4.0K /tmp/.tmpXL75rO/keys
16K /tmp/.tmpXL75rO
4.0K /tmp/.tmphwcrco
4.0K /tmp/.tmpn6w7JO/keys
24M /tmp/.tmpn6w7JO
4.0K /tmp/.tmpof73ki
4.0K /tmp/.tmpq6YAU7/keys
2.8M /tmp/.tmpq6YAU7
4.0K /tmp/.tmptc7tje
4.0K /tmp/.tmpxchcn8
38M total |
This looks to be happening on OSX too, but is a little hard to find the OSX tmp folder leet@leet-tari-m1pro ~ % ls -lda /private/var/folders/_1/tdmqc6vx5lqc1syjyfmll7t40000gn/T/.tmp*
-rw-r-----@ 1 leet staff 64 Jan 13 17:15 /private/var/folders/_1/tdmqc6vx5lqc1syjyfmll7t40000gn/T/.tmp1nrsh4
drwx------@ 9 leet staff 288 Jan 13 17:31 /private/var/folders/_1/tdmqc6vx5lqc1syjyfmll7t40000gn/T/.tmp6rSJH4
drwx------@ 9 leet staff 288 Jan 13 13:31 /private/var/folders/_1/tdmqc6vx5lqc1syjyfmll7t40000gn/T/.tmpHbCj7d
drwx------@ 9 leet staff 288 Jan 13 17:15 /private/var/folders/_1/tdmqc6vx5lqc1syjyfmll7t40000gn/T/.tmpZjBRMK
-rw-r-----@ 1 leet staff 64 Jan 13 17:17 /private/var/folders/_1/tdmqc6vx5lqc1syjyfmll7t40000gn/T/.tmpjvzhaa
-rw-r-----@ 1 leet staff 64 Jan 13 13:30 /private/var/folders/_1/tdmqc6vx5lqc1syjyfmll7t40000gn/T/.tmprmg0ss I found this by running minotari_node, then finding the PID of minotari_node. Using the PID then checked all open files held by the PID and looking for anything that starts with leet@leet-tari-m1pro ~ % lsof -p 75377 |grep -i "/.tmp"
minotari_ 75377 leet 21w REG 1,16 64 66802070 /private/var/folders/_1/tdmqc6vx5lqc1syjyfmll7t40000gn/T/.tmpjvzhaa
minotari_ 75377 leet 22u REG 1,16 0 66802072 /private/var/folders/_1/tdmqc6vx5lqc1syjyfmll7t40000gn/T/.tmp6rSJH4/lock |
These files created in the /tmp or related folder in OSX, seem to be hard coded and not controllable by the user. Would be nice if the user had some control over the name and location, so that clean up and be more controlled for more custom setups, like where a
|
See #6782 - the PR only covered libtor temporary files |
Description --- The base node and console wallet have various immediate exit paths through 'process::exit', as well as controlled exit via user/shutdown command. - This implementation ~~uses a unique but predictable handshake file containing the libtor temporary directory for each base node or console wallet running instance to cover all exit paths. When the main thread exits, via user command or 'process::exit', the libtor temporary files and the handshake file are removed.~~ does away with the temporary libtor data folder and log file and instead uses a fixed or user-controllable location via the `--libtor-data-dir` command line option. - ~~Added libtor exiting logic to:~~ - ~~log any shutdown errors;~~ - ~~remove temporary files.~~ - Added a failsafe timeout for test-liveness. Closes #6739 and #6741 Motivation and Context --- See #6739 and #6741 How Has This Been Tested? --- System-level testing: - Base node (Ubuntu), executing test liveness from the command line, with and without using libtor ``` ./minotari_node --base-path $(realpath .) --log-config $(realpath ./config)/log4rs_node.yml --network esmeralda --disable-splash-screen -p esmeralda.p2p.seeds.dns_seeds= -p esmeralda.p2p.seeds.peer_seeds= --watch "test-peer-liveness f6186e6f15af070d01d5aec8c5a53d81088c34b777cd0b25292d1cd522532462 /onion3/5uqpxi6ando6jrtcpj3aok4z7ab2nm36knfv2pzdf2hefdpkdcjnazid:18141 true true false" --non-interactive-mode -p base_node.use_libtor=true ``` - Base node (Ubuntu), with console, using libtor - Console wallet (Ubuntu), with console, using libtor - Console wallet (Ubuntu), recovery into console, using libtor What process can a PR reviewer use to test or verify this change? --- System-level testing Code review <!-- Checklist --> <!-- 1. Is the title of your PR in the form that would make nice release notes? The title, excluding the conventional commit tag, will be included exactly as is in the CHANGELOG, so please think about it carefully. --> Breaking Changes --- - [x] None - [ ] Requires data directory on base node to be deleted - [ ] Requires hard fork - [ ] Other - Please specify <!-- Does this include a breaking change? If so, include this line as a footer --> <!-- BREAKING CHANGE: Description what the user should do, e.g. delete a database, resync the chain -->
Running
minotari_node
on Linux creates files in/tmp
folder, looks to be tor related and does not clean up after exit.Even cleaning out tari folder and running with libtor disabled:
./minotari_node -b ./tari/ --disable-splash-screen -p use_libtor=false
Still find new temporary files and folder after exit.
Expected behavior
Temporary files should be deleted on exit. This becomes a problem with disk space be used by files that are not need. Becomes a big problem, if base node is re-started often.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: