Come-from-Beyond (OP)
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
|
January 06, 2014, 03:54:50 PM |
|
A SIGTERM shouldn't corrupt anything?
No idea, I prefer BareMetal OS. I don't like interface with a lot of icons.
|
|
|
|
jkoil
|
|
January 06, 2014, 05:17:04 PM Last edit: January 06, 2014, 05:51:44 PM by jkoil |
|
What information transactions.nxt contains? Blockchain Explorer shows just timestamp, numbers, IDs for a transaction, but transactions.nxt contain also names and http addresses. Eg. "warhorse", " http://google.com", "paperwallet", "darkwallet", "cloudwallet", ...
|
|
|
|
gsan1
Newbie
Offline
Activity: 50
Merit: 0
|
|
January 06, 2014, 06:00:13 PM |
|
Line 6707: counter++; if (counter >= 255) {
break;
}
Why is there a counter, so that only 255 transactions get returned? I know that this is the maximum amount of transactions in a block, but there is no reason why I could get more unconfirmed transactions by another peer, isn't it?
|
|
|
|
nexern
|
|
January 06, 2014, 06:03:58 PM |
|
What information transactions.nxt contains? Blockchain Explorer shows just timestamp, numbers, IDs for a transaction, but transactions.nxt contain also names and http addresses. Eg. "warhorse", " http://google.com", "paperwallet", "darkwallet", "cloudwallet", ... these are attached aliases
|
|
|
|
ferment
Full Member
Offline
Activity: 168
Merit: 100
IDEX - LIVE Real-time DEX
|
|
January 06, 2014, 06:30:54 PM |
|
A SIGTERM shouldn't corrupt anything?
No idea, I prefer BareMetal OS. I don't like interface with a lot of icons. SIGTERM is the signal sent by Unix 'kill' command as the standard way to cleanly shutdown a process.
|
|
|
|
Come-from-Beyond (OP)
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
|
January 06, 2014, 06:52:03 PM |
|
Line 6707: counter++; if (counter >= 255) {
break;
}
Why is there a counter, so that only 255 transactions get returned? I know that this is the maximum amount of transactions in a block, but there is no reason why I could get more unconfirmed transactions by another peer, isn't it? This is to limit volume of data sent between nodes.
|
|
|
|
ricot
Newbie
Offline
Activity: 56
Merit: 0
|
|
January 06, 2014, 06:56:08 PM |
|
A SIGTERM shouldn't corrupt anything?
No idea, I prefer BareMetal OS. I don't like interface with a lot of icons. SIGTERM is the signal sent by Unix 'kill' command as the standard way to cleanly shutdown a process. Taking a short look at the code, totally possible that it messes up everything. Usually, you'd first write to a temporary file, and when it's finished you'd move it in place and therefore overwrite the old one, since that's only one atomic operation... In case the process ends while writing, you just have a half-written temporary lying around. This client doesn't do the moving thing, so as soon as you SIGKILL or even SIGTERM it while it's writing, it's in a bad state.
|
|
|
|
LiQio
Legendary
Offline
Activity: 1181
Merit: 1002
|
|
January 06, 2014, 07:24:40 PM |
|
hey ricot, thanks a lot for your work - just sent you a beer! cheers!
|
|
|
|
ferment
Full Member
Offline
Activity: 168
Merit: 100
IDEX - LIVE Real-time DEX
|
|
January 06, 2014, 08:14:13 PM Last edit: January 06, 2014, 08:38:10 PM by ferment |
|
A SIGTERM shouldn't corrupt anything?
No idea, I prefer BareMetal OS. I don't like interface with a lot of icons. SIGTERM is the signal sent by Unix 'kill' command as the standard way to cleanly shutdown a process. Taking a short look at the code, totally possible that it messes up everything. Usually, you'd first write to a temporary file, and when it's finished you'd move it in place and therefore overwrite the old one, since that's only one atomic operation... In case the process ends while writing, you just have a half-written temporary lying around. This client doesn't do the moving thing, so as soon as you SIGKILL or even SIGTERM it while it's writing, it's in a bad state. Ok... brushed up on my Java and dove in: @Override public void destroy() { scheduledThreadPool.shutdown(); cachedThreadPool.shutdown(); try { Block.saveBlocks("blocks.nxt"); } catch (Exception e) { } try { Transaction.saveTransactions("transactions.nxt"); } catch (Exception e) { } try { blockchainChannel.close(); } catch (Exception e) { } logMessage("Nxt stopped."); } }
Since scheduledThreadPool.shutdown() (and cachedThreadPool) doesn't wait for the threads to actually finish before returning, it might create a condition where saveBlocks blocks the threads that are trying to shutdown due to the synchronized on blocks. So it might be possible for destroy() to exit before the thread pools have completely shutdown, which could cause corruption of blocks.nxt if something bad happens in the threads. The fix is to call awaitTermination on the threadpools before call Block.saveBlocks.
|
|
|
|
Jean-Luc
|
|
January 06, 2014, 08:45:12 PM |
|
The fix is to call awaitTermination on the threadpools before call Block.saveBlocks. This has been fixed since 0.4.9e. Waiting up to 10 s, then shutdownNow.
|
|
|
|
ferment
Full Member
Offline
Activity: 168
Merit: 100
IDEX - LIVE Real-time DEX
|
|
January 06, 2014, 09:30:03 PM |
|
The fix is to call awaitTermination on the threadpools before call Block.saveBlocks. This has been fixed since 0.4.9e. Waiting up to 10 s, then shutdownNow. Guess that's not what is killing 80% of my nodes. heh.
|
|
|
|
klee
Legendary
Offline
Activity: 1498
Merit: 1000
|
|
January 06, 2014, 09:31:04 PM |
|
smaragda, ricot, vamdor, ImmortAlex, rlh: Please PM your NXT tip account. Thanks for pouring through the code.
FrictionlessCoin send yours too cuz you need a NXT hug.
Post your addresses guys (gals?) I wanna reward your efforts... ricot : 100K ImmortAlex :50K vamdor: 50K rlh: 50K smaragda: 50K
|
|
|
|
Come-from-Beyond (OP)
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
|
January 06, 2014, 09:38:44 PM |
|
smaragda, ricot, vamdor, ImmortAlex, rlh: Please PM your NXT tip account. Thanks for pouring through the code.
FrictionlessCoin send yours too cuz you need a NXT hug.
Post your addresses guys (gals?) I wanna reward your efforts... ricot : 100K ImmortAlex :50K vamdor: 50K rlh: 50K smaragda: 50K What about FrictionlessCoin?
|
|
|
|
klee
Legendary
Offline
Activity: 1498
Merit: 1000
|
|
January 06, 2014, 09:47:21 PM |
|
smaragda, ricot, vamdor, ImmortAlex, rlh: Please PM your NXT tip account. Thanks for pouring through the code.
FrictionlessCoin send yours too cuz you need a NXT hug.
Post your addresses guys (gals?) I wanna reward your efforts... ricot : 100K ImmortAlex :50K vamdor: 50K rlh: 50K smaragda: 50K What about FrictionlessCoin? I will pay him in his scamcoin
|
|
|
|
utopianfuture
Sr. Member
Offline
Activity: 602
Merit: 268
Internet of Value
|
|
January 06, 2014, 09:47:43 PM |
|
smaragda, ricot, vamdor, ImmortAlex, rlh: Please PM your NXT tip account. Thanks for pouring through the code.
FrictionlessCoin send yours too cuz you need a NXT hug.
Post your addresses guys (gals?) I wanna reward your efforts... ricot : 100K ImmortAlex :50K vamdor: 50K rlh: 50K smaragda: 50K That's great klee. I hope you would be NXT billionaire in two years. Don't forget to helicopter me to your private island at that time
|
|
|
|
klee
Legendary
Offline
Activity: 1498
Merit: 1000
|
|
January 06, 2014, 09:48:26 PM |
|
Post your addresses guys (gals?) I wanna reward your efforts...
ricot : 100K ImmortAlex :50K vamdor: 50K rlh: 50K smaragda: 50K
Is this for real?!? TRULY APPRECIATED! ...address is in my signature... Check!
|
|
|
|
klee
Legendary
Offline
Activity: 1498
Merit: 1000
|
|
January 06, 2014, 09:49:09 PM |
|
smaragda, ricot, vamdor, ImmortAlex, rlh: Please PM your NXT tip account. Thanks for pouring through the code.
FrictionlessCoin send yours too cuz you need a NXT hug.
Post your addresses guys (gals?) I wanna reward your efforts... ricot : 100K ImmortAlex :50K vamdor: 50K rlh: 50K smaragda: 50K That's great klee. I hope you would be NXT billionaire in two years. Don't forget to helicopter me to your private island at that time You will be in my VIP list
|
|
|
|
BloodyRookie
|
|
January 06, 2014, 09:52:40 PM |
|
smaragda, ricot, vamdor, ImmortAlex, rlh: Please PM your NXT tip account. Thanks for pouring through the code.
FrictionlessCoin send yours too cuz you need a NXT hug.
Post your addresses guys (gals?) I wanna reward your efforts... ricot : 100K ImmortAlex :50K vamdor: 50K rlh: 50K smaragda: 50K Hey, I am a nice guy too
|
Nothing Else Matters NEM: NALICE-LGU3IV-Y4DPJK-HYLSSV-YFFWYS-5QPLYE-ZDJJ NXT: 11095639652683007953
|
|
|
Come-from-Beyond (OP)
Legendary
Offline
Activity: 2142
Merit: 1010
Newbie
|
|
January 06, 2014, 09:58:42 PM |
|
|
|
|
|
instacalm
|
|
January 06, 2014, 10:05:41 PM |
|
smaragda, ricot, vamdor, ImmortAlex, rlh: Please PM your NXT tip account. Thanks for pouring through the code.
FrictionlessCoin send yours too cuz you need a NXT hug.
Post your addresses guys (gals?) I wanna reward your efforts... ricot : 100K ImmortAlex :50K vamdor: 50K rlh: 50K smaragda: 50K Greetings to sunny Greece.
|
|
|
|
|