Strange error: Thread crashes on startup #530
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I just noticed this error showing up during startup.
Usually when working with threads please check periodically if they are still running and in case they are not, put the failed task to the end of the queue, so it does not blocks others. Then restart the thread.
For some reason POW is no longer done for any messages.
I found a dirty solution: just comment out the line 897 (and 808, it appears there too) and it works. message is properly delivered and ack is received.
What are the consequences of removing those lines?
Are you running custom code? I don't recognize where this line came from:
I don't see why shared.inventorySets wouldn't have a key of "1" already set. This data structure is used very frequently: whenever you receive an inv message.
To answer your question, the consequence is that the part of the client that processes incoming inv messages won't be aware that you already have this inventory object. This will cause a several unnecessary inventory lookups but it is harmless.
The only custom part I am running is the GPU based PoW function and the FastCPU based function. Since it is much faster than the built in PoW, I don't know if it finishes too early, before there is a key 1 created.
Key 1 is created at startup.
@AyrA does this still happen with the latest code?
I don't know. I have stopped using the bitmessage client completely after I implemented the gateway.
You can test this, by saving an empty knownnodes.dat (just pickle.dump an empty list) and then reopening the client if I remember correctly.
It boild down to the fact, that if there is a network problem, bitmessage slowly deletes each entry, as it can no longer connect, eventually leaving the list empty.
@AyrA Thanks, I think I understand your explanation.
I'm not fully sure, but I think that this happens when you launch PyBitmessage and your worker thread starts creating proof of work for pending messages or pubkey requests before the outbound network connections initialise. This is in theory possible, because the main thread loads your encryption keys between launching the worker thread and calling connectToStream (where inventorySet is properly initialised). If that's the cause, a fix is super easy, just initialise the inventorySet earlier to a state that does not have a missing key for stream 1.
You are pretty much the only one that will realistically trigger this, because you have many addresses in keys.dat and a GPU PoW at the same time. So your worker thread is fast, and the time between launching it and initialising the inventorySet is long. I doubt that I will be able to reproduce this without recreating such an environment. So I made the probable fix without trying to reproduce it.
If anyone still has this problem, let me know, including how to reproduce it.
I solved it myself by fiddling with the thread start order. Has worked for now but certainly is not professional. At the moment, there are close to 15000 active addresses in the system, so if you want to simulate it yourself, you could generate many dummy addresses in your client and try it I assume.
For obvious reasons I can't give you my address list.
I don't want to allocate more time on this for the time being unless I know someone is affected.