Coder Social home page Coder Social logo

Comments (9)

whizz avatar whizz commented on June 17, 2024 1

Oh no, that is nothing new. It’s been this way few years back and is still the case now. I’ll have some time next week so I might finally try to take a look at it.

I remember that I reported this way back in 2017 here kyuupichan/electrumx#179 (comment) but it was closed.

from electrumx.

whizz avatar whizz commented on June 17, 2024

Can confirm. I saw the same thing on low memory systems. And by low memory I mean 4G and less. There’s probably some leak in the initial block processing.

from electrumx.

20a8vnf30 avatar 20a8vnf30 commented on June 17, 2024

I notice that with every crash not only do I lose progress up to the most recent flushing, but from before that, is that supposed to happen? I'm not really making any progress at this point and the Pi has been at it for a few days now.

from electrumx.

JustinTArthur avatar JustinTArthur commented on June 17, 2024

@whizz and @RobinTick has this been a recent occurrence, or something that also occurred before the spesmilo fork?

from electrumx.

20a8vnf30 avatar 20a8vnf30 commented on June 17, 2024

@JustinTArthur This 4GB Raspberry Pi is the first system I'm running the Spesmilo fork on.
I'm succesfully running the older Marodian fork (that still supported Bitcoin) on an x86 Intel NUC with 8GB ram, CACHE_MB is set to 1800 there and I don't remember it crashing this much on initial sync.

from electrumx.

20a8vnf30 avatar 20a8vnf30 commented on June 17, 2024

Update on progress.
Running Spesmilo 0.15.0 on an 8GB RAM system x86 system is a better experience, I saw maybe two process crashes during initial sync, but did achieve full synchronization.

The 4GB RAM Raspberry Pi is still crashing about every hour and is making very slow progress. I tried higher and lower values for CACHE_MB but I'm unable to prevent the process from crashing.
With every crash almost an hour of progress is lost, if you made the process commit new data to disk more often that could mitigate the problem somewhat. Though I'm convinced there's something akin to a memory leak happening here which is the underlying issue.

from electrumx.

20a8vnf30 avatar 20a8vnf30 commented on June 17, 2024

I managed to resolve my crashing on the 4GB Raspberry Pi by setting CACHE_MB = 500, deleting the data and starting over from scratch. I have experienced zero crashes thus far.
I noticed initial progress was MUCH faster this time, almost like all the crashing during my previous sync attempt had left database issues that kept impeding further progress even after the crashing had stopped.

from electrumx.

Robot1982 avatar Robot1982 commented on June 17, 2024

I am also having memory errors during the initial sync with version 1.15.0 and 16 GB RAM. I did not have this problem with an earlier version. I did the first full sync with version 1.13.0 without a crash. Now it is crashing constantly. The error is different than from RobinTick. First I had CACHE_MB = 4096. With CACHE_MB = 2048 it seems better.

Jul 16 01:00:45 server1 electrumx_server[613]: INFO:Prefetcher:cancelled; prefetcher stopping
Jul 16 01:00:45 server1 electrumx_server[613]: INFO:SessionManager:closing down server for rpc://127.0.0.1:8000
Jul 16 01:00:45 server1 electrumx_server[613]: INFO:Controller:shutting down
Jul 16 01:00:45 server1 electrumx_server[613]: INFO:Controller:shutdown complete
Jul 16 01:00:46 server1 electrumx_server[613]: ERROR:electrumx:ElectrumX server terminated abnormally
Jul 16 01:00:46 server1 electrumx_server[613]: Traceback (most recent call last):
Jul 16 01:00:46 server1 electrumx_server[613]: File "/home/electrumx/electrumx_server", line 35, in main
Jul 16 01:00:46 server1 electrumx_server[613]: asyncio.run(controller.run())
Jul 16 01:00:46 server1 electrumx_server[613]: File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
Jul 16 01:00:46 server1 electrumx_server[613]: return loop.run_until_complete(main)
Jul 16 01:00:46 server1 electrumx_server[613]: File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
Jul 16 01:00:46 server1 electrumx_server[613]: return future.result()
Jul 16 01:00:46 server1 electrumx_server[613]: File "/home/electrumx/electrumx/lib/server_base.py", line 125, in run
Jul 16 01:00:46 server1 electrumx_server[613]: await server_task
Jul 16 01:00:46 server1 electrumx_server[613]: File "/home/electrumx/electrumx/lib/server_base.py", line 98, in serve
Jul 16 01:00:46 server1 electrumx_server[613]: await self.serve(shutdown_event)
Jul 16 01:00:46 server1 electrumx_server[613]: File "/home/electrumx/electrumx/server/controller.py", line 134, in serve
Jul 16 01:00:46 server1 electrumx_server[613]: await group.spawn(wait_for_catchup())
Jul 16 01:00:46 server1 electrumx_server[613]: File "/usr/local/lib/python3.7/dist-packages/aiorpcx/curio.py", line 242, in aexit
Jul 16 01:00:46 server1 electrumx_server[613]: await self.join()
Jul 16 01:00:46 server1 electrumx_server[613]: File "/usr/local/lib/python3.7/dist-packages/aiorpcx/curio.py", line 211, in join
Jul 16 01:00:46 server1 electrumx_server[613]: raise task.exception()
Jul 16 01:00:46 server1 electrumx_server[613]: File "/home/electrumx/electrumx/server/block_processor.py", line 681, in fetch_and_process_blocks
Jul 16 01:00:46 server1 electrumx_server[613]: await group.spawn(self._process_prefetched_blocks())
Jul 16 01:00:46 server1 electrumx_server[613]: File "/usr/local/lib/python3.7/dist-packages/aiorpcx/curio.py", line 242, in aexit
Jul 16 01:00:46 server1 electrumx_server[613]: await self.join()
Jul 16 01:00:46 server1 electrumx_server[613]: File "/usr/local/lib/python3.7/dist-packages/aiorpcx/curio.py", line 211, in join
Jul 16 01:00:46 server1 electrumx_server[613]: raise task.exception()
Jul 16 01:00:46 server1 electrumx_server[613]: File "/home/electrumx/electrumx/server/block_processor.py", line 642, in _process_prefetched_blocks
Jul 16 01:00:46 server1 electrumx_server[613]: await self.check_and_advance_blocks(blocks)
Jul 16 01:00:46 server1 electrumx_server[613]: File "/home/electrumx/electrumx/server/block_processor.py", line 219, in check_and_advance_blocks
Jul 16 01:00:46 server1 electrumx_server[613]: await self.run_in_thread_with_lock(self.advance_blocks, blocks)
Jul 16 01:00:46 server1 electrumx_server[613]: File "/home/electrumx/electrumx/server/block_processor.py", line 202, in run_in_thread_with_lock
Jul 16 01:00:46 server1 electrumx_server[613]: return await asyncio.shield(run_in_thread_locked())
Jul 16 01:00:46 server1 electrumx_server[613]: File "/home/electrumx/electrumx/server/block_processor.py", line 201, in run_in_thread_locked
Jul 16 01:00:46 server1 electrumx_server[613]: return await run_in_thread(func, *args)
Jul 16 01:00:46 server1 electrumx_server[613]: File "/usr/local/lib/python3.7/dist-packages/aiorpcx/curio.py", line 68, in run_in_thread
Jul 16 01:00:46 server1 electrumx_server[613]: return await get_event_loop().run_in_executor(None, func, *args)
Jul 16 01:00:46 server1 electrumx_server[613]: File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
Jul 16 01:00:46 server1 electrumx_server[613]: result = self.fn(*self.args, **self.kwargs)
Jul 16 01:00:46 server1 electrumx_server[613]: File "/home/electrumx/electrumx/server/block_processor.py", line 399, in advance_blocks
Jul 16 01:00:46 server1 electrumx_server[613]: undo_info = self.advance_txs(block.transactions, is_unspendable)
Jul 16 01:00:46 server1 electrumx_server[613]: File "/home/electrumx/electrumx/server/block_processor.py", line 448, in advance_txs
Jul 16 01:00:46 server1 electrumx_server[613]: hashX + tx_numb + to_le_uint64(txout.value))
Jul 16 01:00:46 server1 electrumx_server[613]: MemoryError
Jul 16 01:01:10 server1 systemd[1]: electrumx.service: Succeeded.

from electrumx.

github12101 avatar github12101 commented on June 17, 2024

I managed to resolve my crashing on the 4GB Raspberry Pi by setting CACHE_MB = 500, deleting the data and starting over from scratch. I have experienced zero crashes thus far.
I noticed initial progress was MUCH faster this time, almost like all the crashing during my previous sync attempt had left database issues that kept impeding further progress even after the crashing had stopped.

I just suggest for next time to add plenty of swap to your Raspberry. Even on cheap USB stick. That will prevent crashes at least.
Alternatively you can loop electrumx into a script which will restart it self once crash is encountered. That's what I did and I caught many crashes already, never during sync though (I've got plenty of RAM).

from electrumx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.