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

Commit

Permalink
Merge pull request #1994 from LiskHQ/1993-investigate-lisk-core-crash…
Browse files Browse the repository at this point in the history
…-due-to-memory-leak

Investigate lisk-core crash due to memory leak
  • Loading branch information
nagdahimanshu authored Dec 20, 2023
2 parents f9c9ac7 + 4c708ce commit 16f90e1
Show file tree
Hide file tree
Showing 10 changed files with 128 additions and 170 deletions.
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ services:
- ENABLE_TESTING_MODE=${ENABLE_TESTING_MODE}
- ENABLE_BLOCK_CACHING=${ENABLE_BLOCK_CACHING}
- EXPIRY_IN_HOURS=${EXPIRY_IN_HOURS}
- CLIENT_INSTANTIATION_MAX_WAIT_TIME=${CLIENT_INSTANTIATION_MAX_WAIT_TIME}
- CLIENT_INSTANTIATION_RETRY_INTERVAL=${CLIENT_INSTANTIATION_RETRY_INTERVAL}
- CLIENT_ALIVE_ASSUMPTION_TIME=${CLIENT_ALIVE_ASSUMPTION_TIME}
- HEARTBEAT_ACK_MAX_WAIT_TIME=${HEARTBEAT_ACK_MAX_WAIT_TIME}
- ENDPOINT_INVOKE_MAX_RETRIES=${ENDPOINT_INVOKE_MAX_RETRIES}
Expand Down Expand Up @@ -227,6 +225,7 @@ services:
- JOB_INTERVAL_TRIGGER_ACCOUNT_UPDATES=${JOB_INTERVAL_TRIGGER_ACCOUNT_UPDATES}
- JOB_SCHEDULE_TRIGGER_ACCOUNT_UPDATES=${JOB_SCHEDULE_TRIGGER_ACCOUNT_UPDATES}
- ESTIMATES_BUFFER_BYTES_LENGTH=${ESTIMATES_BUFFER_BYTES_LENGTH}
- INVOKE_ALLOWED_METHODS=${INVOKE_ALLOWED_METHODS}
restart: always

blockchain-coordinator:
Expand Down
4 changes: 1 addition & 3 deletions docker/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
## Lisk Service Blockchain Connector

# GENESIS_BLOCK_URL='https://downloads.lisk.com/lisk/mainnet/genesis_block.json.tar.gz'
# CLIENT_INSTANTIATION_MAX_WAIT_TIME=5000
# CLIENT_INSTANTIATION_RETRY_INTERVAL=1
# CLIENT_ALIVE_ASSUMPTION_TIME=5000
# HEARTBEAT_ACK_MAX_WAIT_TIME=1000
# ENDPOINT_INVOKE_MAX_RETRIES=3
Expand Down Expand Up @@ -67,7 +65,7 @@ LISK_APP_WS=ws://host.docker.internal:7887
# ENABLE_SNAPSHOT_ALLOW_INSECURE_HTTP=false
# ACCOUNT_BALANCE_UPDATE_BATCH_SIZE=1000
# INDEX_BLOCKS_QUEUE_SCHEDULED_JOB_MAX_COUNT=100000
# INVOKE_ALLOWED_METHODS='dynamicReward_getExpectedValidatorRewards,token_hasUserAccount,token_getInitializationFees,interoperability_getMinimumMessageFee,txpool_getTransactionsFromPool'
# INVOKE_ALLOWED_METHODS='dynamicReward_getExpectedValidatorRewards,token_hasUserAccount,token_getInitializationFees,interoperability_getMinimumMessageFee,txpool_getTransactionsFromPool,pos_getExpectedSharedRewards'

# Moleculer jobs configuration
# JOB_INTERVAL_DELETE_SERIALIZED_EVENTS=0
Expand Down
12 changes: 0 additions & 12 deletions docs/antora/modules/ROOT/pages/configuration/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -401,18 +401,6 @@ To disable it, set it to `false`.
By default, it is set to `12` hours.
| 12

| `CLIENT_INSTANTIATION_MAX_WAIT_TIME`
| number
| Maximum wait time (in milliseconds) for the API client instantiation before forcefully instantiating a new client when getApiClient is invoked.
By default, it is set to `5000`.
| 5000

| `CLIENT_INSTANTIATION_RETRY_INTERVAL`
| number
| Retry interval (in milliseconds) to invoke instantiate API client when getApiClient is invoked.
By default, it is set to `1`.
| 1

| `CLIENT_ALIVE_ASSUMPTION_TIME`
| number
| Interval (in milliseconds) for which the WS API Client is assumed to be alive since the last ping/pong success check.
Expand Down
4 changes: 1 addition & 3 deletions ecosystem.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ module.exports = {
// SERVICE_LOG_FILE: false,
// DOCKER_HOST: 'local',
// GENESIS_BLOCK_URL: 'https://downloads.lisk.com/lisk/mainnet/genesis_block.json.tar.gz',
// CLIENT_INSTANTIATION_MAX_WAIT_TIME: 5000,
// CLIENT_INSTANTIATION_RETRY_INTERVAL: 1,
// CLIENT_ALIVE_ASSUMPTION_TIME: 5 * 1000,
// HEARTBEAT_ACK_MAX_WAIT_TIME: 1000,
// ENDPOINT_INVOKE_MAX_RETRIES: 3,
Expand Down Expand Up @@ -196,7 +194,7 @@ module.exports = {
// JOB_SCHEDULE_DELETE_FINALIZED_CCU_METADATA: '0 2 * * *',
// JOB_INTERVAL_TRIGGER_ACCOUNT_UPDATES: 0,
// JOB_SCHEDULE_TRIGGER_ACCOUNT_UPDATES: '*/15 * * * *',
// INVOKE_ALLOWED_METHODS: 'dynamicReward_getExpectedValidatorRewards,token_hasUserAccount,token_getInitializationFees,interoperability_getMinimumMessageFee,txpool_getTransactionsFromPool',
// INVOKE_ALLOWED_METHODS: 'dynamicReward_getExpectedValidatorRewards,token_hasUserAccount,token_getInitializationFees,interoperability_getMinimumMessageFee,txpool_getTransactionsFromPool,pos_getExpectedSharedRewards',
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion ecosystem.jenkins.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ module.exports = {
ENABLE_DATA_RETRIEVAL_MODE: true,
ENABLE_INDEXING_MODE: true,
ENABLE_PERSIST_EVENTS: false,
// INVOKE_ALLOWED_METHODS: 'dynamicReward_getExpectedValidatorRewards,token_hasUserAccount,token_getInitializationFees,interoperability_getMinimumMessageFee,txpool_getTransactionsFromPool',
// INVOKE_ALLOWED_METHODS: 'dynamicReward_getExpectedValidatorRewards,token_hasUserAccount,token_getInitializationFees,interoperability_getMinimumMessageFee,txpool_getTransactionsFromPool,pos_getExpectedSharedRewards',
},
},
{
Expand Down
2 changes: 0 additions & 2 deletions jenkins/docker-compose.nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ services:
- ENABLE_TESTING_MODE=${ENABLE_TESTING_MODE}
- ENABLE_BLOCK_CACHING=${ENABLE_BLOCK_CACHING}
- EXPIRY_IN_HOURS=${EXPIRY_IN_HOURS}
- CLIENT_INSTANTIATION_MAX_WAIT_TIME=${CLIENT_INSTANTIATION_MAX_WAIT_TIME}
- CLIENT_INSTANTIATION_RETRY_INTERVAL=${CLIENT_INSTANTIATION_RETRY_INTERVAL}
- CLIENT_ALIVE_ASSUMPTION_TIME=${CLIENT_ALIVE_ASSUMPTION_TIME}
- ENDPOINT_INVOKE_MAX_RETRIES=${ENDPOINT_INVOKE_MAX_RETRIES}
- ENDPOINT_INVOKE_RETRY_DELAY=${ENDPOINT_INVOKE_RETRY_DELAY}
Expand Down
2 changes: 0 additions & 2 deletions services/blockchain-connector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ A list of the most commonly used environment variables is presented below:
- `GEOIP_JSON`: URL of GeoIP server.
- `ENABLE_BLOCK_CACHING`: Boolean flag to enable the block caching. Enabled by default. To disable, set it to `false`.
- `EXPIRY_IN_HOURS`: Expiry time (in hours) for block cache. By default, it is set to 12.
- `CLIENT_INSTANTIATION_MAX_WAIT_TIME`: Maximum wait time (in milliseconds) for the API client instantiation before forcefully instantiating a new client when getApiClient is invoked. By default, it is set to 5000.
- `CLIENT_INSTANTIATION_RETRY_INTERVAL`: Retry interval (in milliseconds) to invoke instantiate API client when getApiClient is invoked. By default, it is set to 5.
- `CLIENT_ALIVE_ASSUMPTION_TIME`: Interval (in milliseconds) for which the WS API Client is assumed to be alive since the last ping/pong success check. By default, it is set to 5000.
- `HEARTBEAT_ACK_MAX_WAIT_TIME`: Maximum time (in milliseconds) within which the checkIsClientAlive's algorithm expects a corresponding `pong` for the `ping` sent to the WS server. By default, it is set to 1000.
- `ENDPOINT_INVOKE_MAX_RETRIES`: Maximum number of endpoint invocation request retries to the node. By default, it is set to 3.
Expand Down
7 changes: 1 addition & 6 deletions services/blockchain-connector/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,7 @@ config.job = {
config.apiClient = {
heartbeatAckMaxWaitTime: Number(process.env.HEARTBEAT_ACK_MAX_WAIT_TIME) || 1000, // in millisecs
aliveAssumptionTime: Number(process.env.CLIENT_ALIVE_ASSUMPTION_TIME) || 5 * 1000, // in millisecs
aliveAssumptionTimeBeforeGenesis: 30 * 1000,
wsConnectionLimit: 10,
instantiation: {
maxWaitTime: Number(process.env.CLIENT_INSTANTIATION_MAX_WAIT_TIME) || 5 * 1000, // in millisecs
retryInterval: Number(process.env.CLIENT_INSTANTIATION_RETRY_INTERVAL) || 1, // in millisecs
},
connectionLimit: 5,
request: {
maxRetries: Number(process.env.ENDPOINT_INVOKE_MAX_RETRIES) || 3,
retryDelay: Number(process.env.ENDPOINT_INVOKE_RETRY_DELAY) || 10, // in millisecs
Expand Down
Loading

0 comments on commit 16f90e1

Please sign in to comment.