From 47a07e3d0a2b74c5f9db7c194a96a31f5c0de4e3 Mon Sep 17 00:00:00 2001 From: yukang Date: Thu, 22 Aug 2024 08:07:47 +0800 Subject: [PATCH 1/6] re_notify verify worker when status is not in Resume --- tx-pool/src/verify_mgr.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tx-pool/src/verify_mgr.rs b/tx-pool/src/verify_mgr.rs index 1e0a9b5a70..9c7cf71359 100644 --- a/tx-pool/src/verify_mgr.rs +++ b/tx-pool/src/verify_mgr.rs @@ -77,6 +77,13 @@ impl Worker { async fn process_inner(&mut self) { loop { if self.status != ChunkCommand::Resume { + info!( + "Worker is not in resume status, current status: {:?}", + self.status + ); + // sleep a while to avoid busy loop + tokio::time::sleep(tokio::time::Duration::from_millis(100)).await; + self.tasks.write().await.re_notify(); return; } // cheap query to check queue is not empty From 47628cc23bfeb55be3b1fb9abc4629e24169437e Mon Sep 17 00:00:00 2001 From: yukang Date: Thu, 22 Aug 2024 08:24:34 +0800 Subject: [PATCH 2/6] enable temporary for debug --- .github/workflows/ci_integration_tests_macos.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci_integration_tests_macos.yaml b/.github/workflows/ci_integration_tests_macos.yaml index ae0fc371ef..173294429f 100644 --- a/.github/workflows/ci_integration_tests_macos.yaml +++ b/.github/workflows/ci_integration_tests_macos.yaml @@ -58,8 +58,7 @@ jobs: if [[ ${{ needs.prologue.outputs.os_skip }} == run ]] && [[ ${{ needs.prologue.outputs.job_skip }} == run ]];then devtools/ci/ci_main.sh else - echo "skip job" - exit 0 + devtools/ci/ci_main.sh fi shell: bash - name: upload log files From 20ea3a514caf56ebbe2bc1d341ae1da957ca4694 Mon Sep 17 00:00:00 2001 From: yukang Date: Thu, 22 Aug 2024 09:24:56 +0800 Subject: [PATCH 3/6] add more log for ci --- test/src/specs/tx_pool/valid_since.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/src/specs/tx_pool/valid_since.rs b/test/src/specs/tx_pool/valid_since.rs index ee16dac4a4..95efebfffb 100644 --- a/test/src/specs/tx_pool/valid_since.rs +++ b/test/src/specs/tx_pool/valid_since.rs @@ -132,10 +132,12 @@ impl ValidSince { { let since = since_from_relative_timestamp(median_time_seconds - 1); let transaction = node.new_transaction_with_since(cellbase.hash(), since); + let res = node + .rpc_client() + .send_transaction_result(transaction.data().into()); + info!("res test_since_relative_median_time {:?}", res); assert!( - node.rpc_client() - .send_transaction_result(transaction.data().into()) - .is_ok(), + res.is_ok(), "transaction's since is greater than tip's median time", ); } From 06103d28e455a03285c54726495484ae60d75f94 Mon Sep 17 00:00:00 2001 From: yukang Date: Thu, 22 Aug 2024 10:19:23 +0800 Subject: [PATCH 4/6] debugging --- test/src/main.rs | 4 ++-- tx-pool/src/verify_mgr.rs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/src/main.rs b/test/src/main.rs index d6a8187e70..702fea3eca 100644 --- a/test/src/main.rs +++ b/test/src/main.rs @@ -395,7 +395,7 @@ fn canonicalize_path>(path: P) -> PathBuf { } fn all_specs() -> Vec> { - let mut specs: Vec> = vec![ + let mut _specs: Vec> = vec![ Box::new(BlockSyncFromOne), Box::new(BlockSyncForks), Box::new(BlockSyncDuplicatedAndReconnect), @@ -468,7 +468,6 @@ fn all_specs() -> Vec> { Box::new(ValidSince), Box::new(SendLowFeeRateTx), Box::new(SendLargeCyclesTxInBlock::new()), - Box::new(SendLargeCyclesTxToRelay::new()), Box::new(NotifyLargeCyclesTx::new()), Box::new(LoadProgramFailedTx::new()), Box::new(RelayWithWrongTx::new()), @@ -598,6 +597,7 @@ fn all_specs() -> Vec> { Box::new(RandomlyKill), Box::new(SyncChurn), ]; + let mut specs: Vec> = vec![Box::new(SendLargeCyclesTxToRelay::new())]; specs.shuffle(&mut thread_rng()); specs } diff --git a/tx-pool/src/verify_mgr.rs b/tx-pool/src/verify_mgr.rs index 9c7cf71359..2255e894b8 100644 --- a/tx-pool/src/verify_mgr.rs +++ b/tx-pool/src/verify_mgr.rs @@ -144,6 +144,7 @@ impl VerifyMgr { // `num_cpus::get()` will always return at least 1, // don't use too many cpu cores to avoid high workload on the system let worker_num = std::cmp::max(num_cpus::get() * 3 / 4, 1); + eprintln!("verify worker_num: {}", worker_num); let workers: Vec<_> = (0..worker_num) .map({ let tasks = Arc::clone(&service.verify_queue); From 4167bebd258443ffe50fecb72616128a9fd5da21 Mon Sep 17 00:00:00 2001 From: yukang Date: Thu, 22 Aug 2024 10:28:46 +0800 Subject: [PATCH 5/6] add debug session --- .github/workflows/ci_integration_tests_macos.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci_integration_tests_macos.yaml b/.github/workflows/ci_integration_tests_macos.yaml index 173294429f..373e8789e3 100644 --- a/.github/workflows/ci_integration_tests_macos.yaml +++ b/.github/workflows/ci_integration_tests_macos.yaml @@ -54,6 +54,8 @@ jobs: runs-on: macos-12 steps: - uses: actions/checkout@v3 + - name: Setup upterm session + uses: lhotari/action-upterm@v1 - run: | if [[ ${{ needs.prologue.outputs.os_skip }} == run ]] && [[ ${{ needs.prologue.outputs.job_skip }} == run ]];then devtools/ci/ci_main.sh From cea795c0263033b82ff60d7bf42e57863c6ffdfa Mon Sep 17 00:00:00 2001 From: yukang Date: Thu, 22 Aug 2024 11:17:50 +0800 Subject: [PATCH 6/6] add log --- Makefile | 2 +- test/src/main.rs | 2 +- test/src/specs/tx_pool/send_large_cycles_tx.rs | 2 +- tx-pool/src/verify_mgr.rs | 4 +++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 91ef1c2a5d..fc77bea738 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ CKB_FEATURES ?= deadlock_detection,with_sentry ALL_FEATURES := deadlock_detection,with_sentry,with_dns_seeding,profiling,march-native CKB_BENCH_FEATURES ?= ci CKB_BUILD_TARGET ?= -INTEGRATION_RUST_LOG := info,ckb_test=debug,ckb_sync=debug,ckb_relay=debug,ckb_network=debug +INTEGRATION_RUST_LOG := debug,ckb_test=debug,ckb_sync=debug,ckb_relay=debug,ckb_network=debug CARGO_TARGET_DIR ?= $(shell pwd)/target BINARY_NAME ?= "ckb" COV_PROFRAW_DIR = ${CARGO_TARGET_DIR}/cov diff --git a/test/src/main.rs b/test/src/main.rs index 702fea3eca..3c76e18a92 100644 --- a/test/src/main.rs +++ b/test/src/main.rs @@ -597,7 +597,7 @@ fn all_specs() -> Vec> { Box::new(RandomlyKill), Box::new(SyncChurn), ]; - let mut specs: Vec> = vec![Box::new(SendLargeCyclesTxToRelay::new())]; + let mut specs: Vec> = vec![Box::new(DAOWithSatoshiCellOccupied)]; specs.shuffle(&mut thread_rng()); specs } diff --git a/test/src/specs/tx_pool/send_large_cycles_tx.rs b/test/src/specs/tx_pool/send_large_cycles_tx.rs index 3ae8eada43..d08c357196 100644 --- a/test/src/specs/tx_pool/send_large_cycles_tx.rs +++ b/test/src/specs/tx_pool/send_large_cycles_tx.rs @@ -106,7 +106,7 @@ impl Spec for SendLargeCyclesTxToRelay { info!("Generate large cycles tx"); let tx = build_tx(node1, &self.random_key.privkey, self.random_key.lock_arg()); - // send tx + // send tx to node1 let ret = node1.rpc_client().send_transaction_result(tx.data().into()); assert!(ret.is_ok()); diff --git a/tx-pool/src/verify_mgr.rs b/tx-pool/src/verify_mgr.rs index 2255e894b8..376bf8c486 100644 --- a/tx-pool/src/verify_mgr.rs +++ b/tx-pool/src/verify_mgr.rs @@ -76,8 +76,9 @@ impl Worker { async fn process_inner(&mut self) { loop { + eprintln!("Worker process_inner begin ...."); if self.status != ChunkCommand::Resume { - info!( + eprintln!( "Worker is not in resume status, current status: {:?}", self.status ); @@ -88,6 +89,7 @@ impl Worker { } // cheap query to check queue is not empty if self.tasks.read().await.is_empty() { + eprintln!("Worker queue is empty"); return; }