Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Check the error exists or not and then return with proper message #3924

Merged
merged 6 commits into from
Jul 9, 2019

Conversation

ishantiw
Copy link
Contributor

@ishantiw ishantiw commented Jul 4, 2019

What was the problem?

Chain comparison is failing even when nodes have the same block.

we get the wierd error,

11:41:58.869Z ERROR lisk-framework: Failed chain recovery after failing to load blocks while network consensus was low. null

How did I fix it?

Check if the error exists or not and form a proper error message.

The below error will be resolved in #3612

 Error: Error loading blocks: Transaction: 5608333921440497612 failed at .multisignature.keysgroup: '.multisignature.keysgroup' should NOT have fewer than 1 items

How to test it?

Sync with alphanet (jenkinsnet-19).

Review checklist

@ishantiw ishantiw self-assigned this Jul 4, 2019
@ishantiw ishantiw requested a review from 4miners July 4, 2019 16:32
Copy link
Contributor

@4miners 4miners left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All new code is covered with unit tests - where? 😢

@ishantiw
Copy link
Contributor Author

ishantiw commented Jul 5, 2019

@4miners There is no unit test for loader.js at all for which I opened an issue during technical debt. #3781. Should we handle it separately in that issue?

framework/src/modules/chain/submodules/loader.js Outdated Show resolved Hide resolved
framework/src/modules/chain/submodules/loader.js Outdated Show resolved Hide resolved
framework/src/modules/chain/submodules/loader.js Outdated Show resolved Hide resolved
@nazarhussain
Copy link
Contributor

Other then just log error messages LGTM

@ishantiw ishantiw requested a review from nazarhussain July 5, 2019 16:57
@ishantiw ishantiw requested a review from 4miners July 8, 2019 16:08
@ishantiw
Copy link
Contributor Author

ishantiw commented Jul 8, 2019

@4miners Added the unit test for the specific error that has been updated in this PR

@4miners
Copy link
Contributor

4miners commented Jul 9, 2019

Unit tests failed because of deadlock:

09:32:32        ✓ should call _getResults with proper param for extended=false (65ms)
09:32:32  { error: deadlock detected
09:32:32      at Connection.parseE (/home/lisk/workspace/lisk-sdk-framework_PR-3924/node_modules/pg/lib/connection.js:554:11)
09:32:32      at Connection.parseMessage (/home/lisk/workspace/lisk-sdk-framework_PR-3924/node_modules/pg/lib/connection.js:379:19)
09:32:32      at Socket.<anonymous> (/home/lisk/workspace/lisk-sdk-framework_PR-3924/node_modules/pg/lib/connection.js:119:22)
09:32:32      at Socket.emit (events.js:189:13)
09:32:32      at Socket.EventEmitter.emit (domain.js:441:20)
09:32:32      at addChunk (_stream_readable.js:284:12)
09:32:32      at readableAddChunk (_stream_readable.js:265:11)
09:32:32      at Socket.Readable.push (_stream_readable.js:220:10)
09:32:32      at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
09:32:32    name: 'error',
09:32:32    length: 337,
09:32:32    severity: 'ERROR',
09:32:32    code: '40P01',
09:32:32    detail:
09:32:32     'Process 28691 waits for AccessExclusiveLock on relation 32898950 of database 32898740; blocked by process 28543.\nProcess 28543 waits for AccessShareLock on relation 32898928 of database 32898740; blocked by process 28691.',
09:32:32    hint: 'See server log for query details.',
09:32:32    position: undefined,
09:32:32    internalPosition: undefined,
09:32:32    internalQuery: undefined,
09:32:32    where: undefined,
09:32:32    schema: undefined,
09:32:32    table: undefined,
09:32:32    column: undefined,
09:32:32    dataType: undefined,
09:32:32    constraint: undefined,
09:32:32    file: 'deadlock.c',
09:32:32    line: '1140',
09:32:32    routine: 'DeadLockReport' }
09:32:32  error error: deadlock detected
09:32:32  error task(db:seed:reset): TRUNCATE TABLE "blocks" CASCADE
09:32:32        - should accept "tx" as last parameter and pass to adapter.executeFile
09:32:32        - should not change any of the provided parameter
09:32:32        filters
09:32:32        ✓ should resolve promise without any error if no data is passed
09:32:33          ✓ should have only specific filters
09:32:33        ✓ should call _getResults with proper param for extended=true
09:32:33        1) "after each" hook for "should call adapter.executeFile with proper param for extended=true"
09:32:33  
09:32:33  
09:32:33    13 passing (18s)
09:32:33    1 failing
09:32:33  
09:32:33    1) Transaction
09:32:33         "after each" hook for "should call adapter.executeFile with proper param for extended=true":
09:32:33       BatchError: deadlock detected

It doesn't look like this is related with the changes in the PR, however I add comment for reference.

@shuse2 shuse2 merged commit f71791d into release/2.0.0 Jul 9, 2019
@shuse2 shuse2 deleted the 3915-chain_comparison_fail_when_nodes_sync branch July 9, 2019 08:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants