eprbell / rp2

Privacy-focused, free, open-source cryptocurrency tax calculator for multiple countries: it handles multiple coins/exchanges and computes long/short-term capital gains, cost bases, in/out lot relationships/fractioning, and account balances. It supports FIFO, LIFO, HIFO and it outputs in form 8949 format. It has a programmable plugin architecture
https://pypi.org/project/rp2/
Apache License 2.0
256 stars 42 forks source link

RP2 process runs after "DONE" #85

Closed gbtorrance closed 1 year ago

gbtorrance commented 1 year ago

When I run rp2_us, even after the reports are generated and the logs say INFO: Done the process continues to run for a very long time with actual CPU utilization (0.3% - 1.7% typically). Eventually it stops on its own. (I don't know exactly how long it runs after INFO: Done, as I left the computer, but it was at least 10 minutes.)

Is it still doing actual "work" during this period, or is there something wrong? Thanks.

eprbell commented 1 year ago

After logging "Done", RP2 exits and does nothing else. Can you paste info on how you observed the behavior (i.e. ps aux or similar)?

gbtorrance commented 1 year ago

OK, weird. So here is an execution of rp2 in the background terminal. Notice how the prompt has not yet returned. It shows INFO: Done, but is seemingly still running. I then did a ps in the foreground terminal, and it shows it is still running. It has been like this for 5+ minutes now.

image

For what it's worth, this is running in a VirtualBox guest (Linux Mint 21). It doesn't have a lot of resources and is kind of slow (though it got to INFO: Done fairly quickly). It has access to 1 CPU, and is using swap space for virtual memory as actual memory is limited. (I'm using a VM rather than running on the host because the version of Linux Mint I'm running on the host has both python 2 and python 3, and I was running into issues with getting rp2 to run properly.)

gbtorrance commented 1 year ago

I anticipated you might ask, so I freed up resources on the host and allocated much more to the guest. 4 CPUs and 4 GB of total RAM. This time it executed fine and ended promptly. So it seems it was purely a resources issue and not related to rp2. Sorry for the hassle. Please feel free to close the ticket. Thanks.

gbtorrance commented 1 year ago

After some further tests I settled on 2 CPUs and 2.5 GB RAM for the guest VM. That seems to perform quite well (and exits promptly). I could probably even reduce more, but that seems fine for now.

eprbell commented 1 year ago

Sounds good: it does sound like an issue with low resource systems.