Skip to content

Commit

Permalink
Ignore AsyncCancelled exception for the ex-units evaluator
Browse files Browse the repository at this point in the history
  Client protocols implements some internal try-catch logic with recovery to allow recovering from codecs errors and incompatibility with the node. Yet, this was wrongly catching async cancellation on the special clients that are spun up concurrently for handling transaction evaluations; causing them to stay alive and pile up over time.

  This commits also adds the total number of active connections to the dashboard, which would have helped noticing that earlier.

  Fixes #403.
  • Loading branch information
KtorZ committed Jul 12, 2024
1 parent b0ba2ae commit a470ef4
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 88 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ layout: changelog
pre: "<b>5. </b>"
---

### [6.5.0] - UNRELEASED
### [6.5.0] - 2024-07-12

### Added

Expand Down Expand Up @@ -98,6 +98,8 @@ $$

- Roll back down to GHC-9.4.8 in an attempt to fix [#399](https://github.com/CardanoSolutions/ogmios/issues/399) possibly caused by a bug in GHC runtime system (possibly patched on 9.4.x).

- Fixed transaction evaluation internal client not being properly terminated and cleaned up after use; resulting in active connections piling up over time. See [#403](https://github.com/CardanoSolutions/ogmios/issues/399).

- Fixed the reported `activeStakeInEpoch` on the `queryLedgerState/rewardsProvenance`, which was mistakenly reporting the `totalStakeInEpoch`. A new value `totalStakeInEpoch` also now correctly reports that information.

#### Removed
Expand Down
16 changes: 15 additions & 1 deletion server/dashboard/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,19 @@
</div>
<div class="column col-1"></div>

<div class="column col-1"></div>
<div class="column col-5 my-2">
<span class="chip bg-primary py-1">
<svg class="feather mr-2 py-1 s-rounded" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle>
</svg>
<span style="font-variant: small-caps;">Active clients</span>
</div>
<div class="column col-5 my-2 text-right">
<span id="active-connections">?</span>
</div>
<div class="column col-1"></div>

<div class="column col-1"></div>
<div class="column col-5 my-2">
<span class="chip bg-primary py-1">
Expand Down Expand Up @@ -194,10 +207,11 @@
status.classList.add('label-error');
}

sel('#last-update').innerText = (health.lastKnownTip || {}).slot || '?';
sel('#last-update').innerText = health.lastKnownTip?.slot ?? '?';
sel('#last-update').setAttribute('data-badge', lastUpdate(health.lastTipUpdate));
sel('#network-synchronization').setAttribute('data-badge', percentage(health.networkSynchronization));
sel('#network-synchronization').innerText = health.network;
sel('#active-connections').innerText = health.metrics?.activeConnections ?? '?';
sel('#version').innerText = `-${health.version}`
all('.era').forEach(era => {
const currentEra = (health.currentEra || "Byron").toLowerCase();
Expand Down
83 changes: 1 addition & 82 deletions server/dashboard/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -831,11 +831,6 @@ abortcontroller-polyfill@^1.1.9:
resolved "https://registry.yarnpkg.com/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.5.tgz#6738495f4e901fbb57b6c0611d0c75f76c485bed"
integrity sha512-JMJ5soJWP18htbbxJjG7bG6yuI6pRhgJ0scHHTfkUjf6wjP912xZWvM+A4sJK3gqd9E8fcPbDnOefbA9Th/FIQ==

ansi-colors@^4.1.1:
version "4.1.3"
resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b"
integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==

ansi-styles@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
Expand Down Expand Up @@ -1010,21 +1005,14 @@ domelementtype@^2.0.1, domelementtype@^2.2.0:
resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d"
integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==

domhandler@^3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-3.3.0.tgz#6db7ea46e4617eb15cf875df68b2b8524ce0037a"
integrity sha512-J1C5rIANUbuYK+FuFL98650rihynUOEzRLxW+90bKZRWB6A1X1Tf82GxR1qAWLyfNPRvjqfip3Q5tdYlmAa9lA==
dependencies:
domelementtype "^2.0.1"

domhandler@^4.2.0, domhandler@^4.2.2, domhandler@^4.3.1:
version "4.3.1"
resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.3.1.tgz#8d792033416f59d68bc03a5aa7b018c1ca89279c"
integrity sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==
dependencies:
domelementtype "^2.2.0"

domutils@^2.4.2, domutils@^2.8.0:
domutils@^2.8.0:
version "2.8.0"
resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135"
integrity sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==
Expand Down Expand Up @@ -1070,11 +1058,6 @@ escalade@^3.1.1:
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==

escape-goat@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/escape-goat/-/escape-goat-3.0.0.tgz#e8b5fb658553fe8a3c4959c316c6ebb8c842b19c"
integrity sha512-w3PwNZJwRxlp47QGzhuEBldEqVHHhh8/tIPcl6ecf2Bou99cdAt0knihBV0Ecc7CGxYduXVBDheH1K2oADRlvw==

escape-string-regexp@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
Expand Down Expand Up @@ -1128,16 +1111,6 @@ htmlnano@^2.0.0:
posthtml "^0.16.5"
timsort "^0.3.0"

htmlparser2@^5.0.0:
version "5.0.1"
resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-5.0.1.tgz#7daa6fc3e35d6107ac95a4fc08781f091664f6e7"
integrity sha512-vKZZra6CSe9qsJzh0BjBGXo8dvzNsq/oGvsjfRdOrrryfeD9UOBEEQdeoqCRmKZchF5h2zOBMQ6YuQ0uRUmdbQ==
dependencies:
domelementtype "^2.0.1"
domhandler "^3.3.0"
domutils "^2.4.2"
entities "^2.0.0"

htmlparser2@^7.1.1:
version "7.2.0"
resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-7.2.0.tgz#8817cdea38bbc324392a90b1990908e81a65f5a5"
Expand Down Expand Up @@ -1304,11 +1277,6 @@ micromatch@^4.0.5:
braces "^3.0.2"
picomatch "^2.3.1"

mime@^2.4.6:
version "2.6.0"
resolved "https://registry.yarnpkg.com/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367"
integrity sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==

msgpackr-extract@^3.0.1, msgpackr-extract@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/msgpackr-extract/-/msgpackr-extract-3.0.2.tgz#e05ec1bb4453ddf020551bcd5daaf0092a2c279d"
Expand Down Expand Up @@ -1347,13 +1315,6 @@ node-addon-api@^7.0.0:
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-7.0.0.tgz#8136add2f510997b3b94814f4af1cce0b0e3962e"
integrity sha512-vgbBJTS4m5/KkE16t5Ly0WW9hz46swAstv0hYYwMtbG7AznRhNyfLRe8HZAiWIpcHzoO7HxhLuBQj9rJ/Ho0ZA==

node-fetch@^2.6.0:
version "2.6.12"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.12.tgz#02eb8e22074018e3d5a83016649d04df0e348fba"
integrity sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==
dependencies:
whatwg-url "^5.0.0"

[email protected]:
version "5.0.6"
resolved "https://registry.yarnpkg.com/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.0.6.tgz#2949f5cc7dace3ac470fa2ff1a37456907120a1d"
Expand Down Expand Up @@ -1386,13 +1347,6 @@ ordered-binary@^1.4.0:
resolved "https://registry.yarnpkg.com/ordered-binary/-/ordered-binary-1.4.1.tgz#205cb6efd6c27fa0ef4eced994a023e081cdc911"
integrity sha512-9LtiGlPy982CsgxZvJGNNp2/NnrgEr6EAyN3iIEP3/8vd3YLgAZQHbQ75ZrkfBRGrNg37Dk3U6tuVb+B4Xfslg==

parcel-plugin-inliner@^1.0.16:
version "1.0.16"
resolved "https://registry.yarnpkg.com/parcel-plugin-inliner/-/parcel-plugin-inliner-1.0.16.tgz#0c7c3f71bcbc6bb45564a642104312b3da9ed72b"
integrity sha512-2HQUmGshACIPO2paraojM79sII1p3kkUQ6IfCVuiO0RyLYta2nQ4y2w/X1Y0RaL1txshJQj3QptCB+R9JEVmgQ==
dependencies:
posthtml-inline-assets "^3.1.0"

parcel@^2.9.3:
version "2.9.3"
resolved "https://registry.yarnpkg.com/parcel/-/parcel-2.9.3.tgz#315660ccbaa5a830cf71280ab0cfbd3079247cc5"
Expand Down Expand Up @@ -1583,11 +1537,6 @@ to-regex-range@^5.0.1:
dependencies:
is-number "^7.0.0"

tr46@~0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==

tslib@^2.4.0:
version "2.6.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.1.tgz#fd8c9a0ff42590b25703c0acb3de3d3f4ede0410"
Expand All @@ -1611,41 +1560,11 @@ utility-types@^3.10.0:
resolved "https://registry.yarnpkg.com/utility-types/-/utility-types-3.10.0.tgz#ea4148f9a741015f05ed74fd615e1d20e6bed82b"
integrity sha512-O11mqxmi7wMKCo6HKFt5AhO4BwY3VV68YU07tgxfz8zJTIxr4BpsezN49Ffwy9j3ZpwwJp4fkRwjRzq3uWE6Rg==

valid-data-url@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/valid-data-url/-/valid-data-url-3.0.1.tgz#826c1744e71b5632e847dd15dbd45b9fb38aa34f"
integrity sha512-jOWVmzVceKlVVdwjNSenT4PbGghU0SBIizAev8ofZVgivk/TVHXSbNL8LP6M3spZvkR9/QolkyJavGSX5Cs0UA==

weak-lru-cache@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/weak-lru-cache/-/weak-lru-cache-1.2.2.tgz#fdbb6741f36bae9540d12f480ce8254060dccd19"
integrity sha512-DEAoo25RfSYMuTGc9vPJzZcZullwIqRDSI9LOy+fkCJPi6hykCnfKaXTuPBDuXAUcqHXyOgFtHNp/kB2FjYHbw==

web-resource-inliner@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/web-resource-inliner/-/web-resource-inliner-6.0.1.tgz#df0822f0a12028805fe80719ed52ab6526886e02"
integrity sha512-kfqDxt5dTB1JhqsCUQVFDj0rmY+4HLwGQIsLPbyrsN9y9WV/1oFDSx3BQ4GfCv9X+jVeQ7rouTqwK53rA/7t8A==
dependencies:
ansi-colors "^4.1.1"
escape-goat "^3.0.0"
htmlparser2 "^5.0.0"
mime "^2.4.6"
node-fetch "^2.6.0"
valid-data-url "^3.0.0"

webidl-conversions@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==

whatwg-url@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d"
integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==
dependencies:
tr46 "~0.0.3"
webidl-conversions "^3.0.0"

xxhash-wasm@^0.4.2:
version "0.4.2"
resolved "https://registry.yarnpkg.com/xxhash-wasm/-/xxhash-wasm-0.4.2.tgz#752398c131a4dd407b5132ba62ad372029be6f79"
Expand Down
14 changes: 11 additions & 3 deletions server/src/Ogmios/App/Protocol.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ import GHC.Generics
)
import Ogmios.Control.Exception
( MonadCatch (..)
, MonadThrow (..)
)
import Ogmios.Control.MonadAsync
( AsyncCancelled (..)
)
import Ogmios.Data.EraTranslation
( MultiEraUTxO
Expand Down Expand Up @@ -193,6 +197,10 @@ defaultWithInternalError
defaultWithInternalError reportException opts continue yield toResponse = do
handle $ \(e :: SomeException) -> do
let (Rpc.Response _ mirror _) = toResponse (error "unused and unevaluated")
reportException e
yield $ Rpc.ko opts $ Rpc.internalError mirror (displayException e)
continue
case fromException e of
Just AsyncCancelled ->
throwIO e
_ -> do
yield $ Rpc.ko opts $ Rpc.internalError mirror (displayException e)
reportException e
continue
2 changes: 1 addition & 1 deletion server/static/dashboard.html

Large diffs are not rendered by default.

Binary file modified server/static/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a470ef4

Please sign in to comment.