{
 "number": 36347,
 "repo": "bitcoin/bitcoin",
 "url": "https://github.com/bitcoin/bitcoin/pull/36347",
 "title": "node: don't abort on invalid -dbcache in settings.json",
 "author": "0xShadowX",
 "author_association": "FIRST_TIME_CONTRIBUTOR",
 "created_at": "2026-09-26T17:16:38Z",
 "updated_at": "2026-11-01T21:34:47Z",
 "description_hash": "f1dc0946cf053713",
 "age_days": 36,
 "draft": false,
 "labels": [],
 "milestone": null,
 "base": "master",
 "head_sha": "2e00693220d8fae784906f802892c60cba718fb2",
 "head_ref": "fix-dbcache-settings-abort",
 "head_repo": "0xShadowX/bitcoin",
 "head_history": [
  {
   "t": "2026-10-07T20:48:51Z",
   "sha": "47e3f3633e464c701dc4c4038646fee266d5c1a5"
  },
  {
   "t": "2026-10-13T20:32:02Z",
   "sha": "2e00693220d8fae784906f802892c60cba718fb2"
  }
 ],
 "additions": 14,
 "deletions": 2,
 "changed_files": 3,
 "commit_count": 1,
 "size_bucket": "S",
 "mergeable_state": "clean",
 "bot": {
  "drahtbot": {
   "present": true,
   "reviews": {
    "ack": [
     {
      "login": "8144225309",
      "url": "https://github.com/bitcoin/bitcoin/pull/36347#issuecomment-6562098347"
     },
     {
      "login": "Hamza1610",
      "url": "https://github.com/bitcoin/bitcoin/pull/36347#issuecomment-6564210409"
     }
    ]
   },
   "conflicts": []
  }
 },
 "acks_parsed": {
  "8144225309": {
   "kind": "ack",
   "hash": "2e00693220d8fae784906f802892c60cba718fb2",
   "t": "2026-11-01T18:30:25Z",
   "stale": false
  },
  "Hamza1610": {
   "kind": "ack",
   "hash": null,
   "t": "2026-11-01T21:34:43Z",
   "stale": false
  }
 },
 "acks_tally": {
  "ack": 2,
  "stale_ack": 0,
  "concept_ack": 0,
  "approach_ack": 0,
  "nack": 0,
  "concept_nack": 0,
  "approach_nack": 0
 },
 "reviews": {
  "approved": 0,
  "changes_requested": 0,
  "distinct_reviewers": [
   "8144225309",
   "Hamza1610",
   "maflcko"
  ]
 },
 "signals": {
  "needs_rebase": false,
  "ci_failed": false,
  "mergeable_state": "clean",
  "last_author_activity": "2026-10-13T20:32:33Z",
  "last_reviewer_activity": "2026-11-01T21:34:43Z",
  "last_reviewer": "Hamza1610",
  "author_silent_days": 19,
  "waiting_on_author_days": 0,
  "days_since_update": 0
 },
 "refs": {
  "mentioned": [
   33333
  ],
  "depends_on": [],
  "fixes": [],
  "linked_issues": [],
  "references": [
   {
    "number": 33333,
    "type": "pull",
    "state": "closed",
    "merged": true,
    "merged_at": "2025-09-18",
    "title": "coins: warn on oversized `-dbcache`"
   }
  ],
  "conflicts": []
 },
 "stack": {
  "shares_commits_with": [],
  "based_on": [],
  "base_for": []
 },
 "review_paths": [
  "test/functional/feature_settings.py"
 ],
 "body": "`LogOversizedDbCache` (added in #33333) is `noexcept`, but it reads `-dbcache` through `CalculateDbCacheBytes` -> `GetIntArg`. `GetIntArg` throws when settings.json has a number that isn't an integer or doesn't fit in int64, e.g. `{\"dbcache\": 4096.5}`. The exception hits the `noexcept` boundary and bitcoind aborts during startup:\n\n```\nlibc++abi: terminating due to uncaught exception of type std::runtime_error: JSON integer out of range\n```\n\nThis removes `noexcept`. The exception now reaches the handler in `AppInit`, and the node exits with status 1 and an error message instead of aborting:\n\n```\nEXCEPTION: St13runtime_error\nJSON integer out of range\nbitcoin in AppInit()\n```\n\nThe added case in `feature_settings.py` writes `{\"dbcache\": 4096.5}` to settings.json and checks that startup fails with that message from `AppInit`.",
 "commits": [
  {
   "sha": "2e00693220d8fae784906f802892c60cba718fb2",
   "date": "2026-10-13T20:31:59Z",
   "message": "node: don't abort on invalid -dbcache in settings.json\n\nLogOversizedDbCache is noexcept, but it reads -dbcache through\nGetIntArg, which throws when settings.json holds a number that is not\nan integer or doesn't fit in int64 (e.g. {\"dbcache\": 4096.5}). The\nexception hits the noexcept boundary and std::terminate aborts\nbitcoind during startup.\n\nRemove noexcept so the exception reaches AppInit like it does for other\ninteger settings, and the node exits with an error message instead of\naborting."
  }
 ],
 "timeline": [
  {
   "t": "2026-10-05T21:50:02Z",
   "kind": "comment",
   "who": "8144225309",
   "assoc": "CONTRIBUTOR",
   "text": "ACK 75e297d79101f817b7b550747c8e6434e619d2f5\n\nOn master a non-integer `dbcache` in settings.json aborts the node at startup. This change makes it exit with an error through `AppInit`, and the new test fails without it.",
   "id": "c:6003733586",
   "url": "https://github.com/bitcoin/bitcoin/pull/36347#issuecomment-6003733586",
   "hash": "1928d8eee11e103e",
   "edited": null
  },
  {
   "t": "2026-10-07T19:20:57Z",
   "kind": "review_comment",
   "who": "Hamza1610",
   "assoc": "NONE",
   "path": "test/functional/feature_settings.py",
   "commit": "2e00693220d8fae784906f802892c60cba718fb2",
   "in_reply_to": null,
   "text": "I would suggest that there is test for integer eg. 4096. makes",
   "id": "rc:4211011331",
   "url": "https://github.com/bitcoin/bitcoin/pull/36347#discussion_r4211011331",
   "hash": "28a8cef01b9bc9f9",
   "edited": "2026-10-07T19:22:46Z"
  },
  {
   "t": "2026-10-07T19:22:46Z",
   "kind": "review",
   "who": "Hamza1610",
   "assoc": "NONE",
   "state": "COMMENTED",
   "commit": "75e297d79101f817b7b550747c8e6434e619d2f5",
   "text": "Concept ACK",
   "id": "r:5447215480",
   "url": "https://github.com/bitcoin/bitcoin/pull/36347#pullrequestreview-5447215480",
   "hash": "e8334cc43879b73c",
   "edited": null
  },
  {
   "t": "2026-10-07T20:48:51Z",
   "kind": "force_push",
   "who": "0xShadowX",
   "commit": "47e3f3633e464c701dc4c4038646fee266d5c1a5",
   "id": "push:47e3f3633e464c701dc4c4038646fee266d5c1a5"
  },
  {
   "t": "2026-10-07T20:49:07Z",
   "kind": "review_comment",
   "who": "0xShadowX",
   "assoc": "NONE",
   "path": "test/functional/feature_settings.py",
   "commit": "2e00693220d8fae784906f802892c60cba718fb2",
   "in_reply_to": 4211011331,
   "text": "Added a test with `dbcache: 4096` in 47e3f3633e: the node starts and the value is read from the settings file. I put it before the non-integer case so the later `-nosettings` checks still see an invalid settings file.",
   "id": "rc:4211825942",
   "url": "https://github.com/bitcoin/bitcoin/pull/36347#discussion_r4211825942",
   "hash": "21afdb5226cfd87d",
   "edited": "2026-10-07T20:49:08Z"
  },
  {
   "t": "2026-10-08T12:53:14Z",
   "kind": "comment",
   "who": "Hamza1610",
   "assoc": "NONE",
   "text": "ACK [47e3f36](https://github.com/bitcoin/bitcoin/pull/36347/commits/47e3f3633e464c701dc4c4038646fee266d5c1a5)",
   "id": "c:6060298210",
   "url": "https://github.com/bitcoin/bitcoin/pull/36347#issuecomment-6060298210",
   "hash": "419f8a714a3d081b",
   "edited": "2026-10-08T12:55:52Z"
  },
  {
   "t": "2026-10-13T16:44:05Z",
   "kind": "comment",
   "who": "maflcko",
   "assoc": "MEMBER",
   "text": "The ci fails. Can this be closed, or are you still working on this?",
   "id": "c:6150515397",
   "url": "https://github.com/bitcoin/bitcoin/pull/36347#issuecomment-6150515397",
   "hash": "65909099b10e7659",
   "edited": null
  },
  {
   "t": "2026-10-13T20:32:02Z",
   "kind": "force_push",
   "who": "0xShadowX",
   "commit": "2e00693220d8fae784906f802892c60cba718fb2",
   "id": "push:2e00693220d8fae784906f802892c60cba718fb2"
  },
  {
   "t": "2026-10-13T20:32:33Z",
   "kind": "comment",
   "who": "0xShadowX",
   "assoc": "NONE",
   "text": "The failure was in the new test, not the fix: `{\"dbcache\": 4096}` triggers the oversized-dbcache warning on the 7 GiB macOS runner, and the unexpected stderr fails `stop_node`. Switched the test values to 300 / 300.5, which stay below the 450 MiB floor of `ShouldWarnOversizedDbCache`, so the warning can't fire on any machine. Still interested in getting this in.",
   "id": "c:6154628221",
   "url": "https://github.com/bitcoin/bitcoin/pull/36347#issuecomment-6154628221",
   "hash": "e6421802c175b1c2",
   "edited": null
  },
  {
   "t": "2026-11-01T18:30:25Z",
   "kind": "comment",
   "who": "8144225309",
   "assoc": "CONTRIBUTOR",
   "text": "re-ACK 2e00693220d8fae784906f802892c60cba718fb2",
   "id": "c:6562098347",
   "url": "https://github.com/bitcoin/bitcoin/pull/36347#issuecomment-6562098347",
   "hash": "f0fb0a71996979a0",
   "edited": null
  },
  {
   "t": "2026-11-01T21:34:43Z",
   "kind": "comment",
   "who": "Hamza1610",
   "assoc": "NONE",
   "text": "re-ACK https://github.com/bitcoin/bitcoin/commit/2e00693220d8fae784906f802892c60cba718fb2",
   "id": "c:6564210409",
   "url": "https://github.com/bitcoin/bitcoin/pull/36347#issuecomment-6564210409",
   "hash": "3f9983e56ad3074e",
   "edited": null
  }
 ],
 "labels_log": [
  {
   "t": "2026-10-09T16:37:57Z",
   "action": "labeled",
   "label": "CI failed",
   "who": "DrahtBot"
  },
  {
   "t": "2026-10-20T08:21:00Z",
   "action": "unlabeled",
   "label": "CI failed",
   "who": "DrahtBot"
  }
 ],
 "state_log": [],
 "text_chars": 2578,
 "text_tokens_estimate": 644,
 "changed_paths": [
  "src/node/caches.cpp",
  "src/node/caches.h",
  "test/functional/feature_settings.py"
 ],
 "files": [
  {
   "path": "src/node/caches.cpp",
   "add": 1,
   "del": 1
  },
  {
   "path": "src/node/caches.h",
   "add": 1,
   "del": 1
  },
  {
   "path": "test/functional/feature_settings.py",
   "add": 12,
   "del": 0
  }
 ],
 "test_lines": 12,
 "git": {
  "head": "2e00693220d8fae784906f802892c60cba718fb2",
  "head_matches_backup": true,
  "base": "ed7dd7cf4e1561a97edf72eba29a67b14e28c717",
  "patch_id": "fb6fcf1f59de08b3",
  "commits": [
   {
    "sha": "2e00693220",
    "subject": "node: don't abort on invalid -dbcache in settings.json",
    "files": 3,
    "add": 14,
    "del": 2
   }
  ],
  "patch_truncated": false
 },
 "patch_id": "fb6fcf1f59de08b3",
 "input_hash": "62128108a77d26f1",
 "extracted_at": "2026-11-02T01:09:49+00:00"
}