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

fix(PE-4612): testing an updating promise cache that does not await on puts #43

Merged
merged 3 commits into from
Sep 19, 2023

Conversation

dtfiedler
Copy link
Collaborator

@dtfiedler dtfiedler commented Sep 19, 2023

Reproduct

  • yarn start:dev
  • curl -iL http://localhost:3000/v1/contract/9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY

Before

info: Server is listening... {"keepAliveTimeout":120000,"port":3000,"requestTimeout":120000,"timestamp":"2023-09-19T17:34:16.618Z"}
debug: Fetching contract state {"contractTxId":"9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","method":"GET","path":"/v1/contract/9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","timestamp":"2023-09-19T17:34:19.049Z","trace":"6b65b4"}
debug: Reading through to contract manifest... {"contractTxId":"9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","method":"GET","path":"/v1/contract/9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","timestamp":"2023-09-19T17:34:19.050Z","trace":"6b65b4"}
debug: Reading through to contract state... {"cacheKey":"9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY-5297cce89e5ff0c40dfefa35d96c1f8f2067e9956bdbc09a013966adebd3bd00","contractTxId":"9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","method":"GET","path":"/v1/contract/9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","timestamp":"2023-09-19T17:34:19.297Z","trace":"6b65b4"}
debug: Evaluating contract state... {"cacheKey":"9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY-5297cce89e5ff0c40dfefa35d96c1f8f2067e9956bdbc09a013966adebd3bd00","contractTxId":"9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","method":"GET","path":"/v1/contract/9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","timestamp":"2023-09-19T17:34:19.297Z","trace":"6b65b4"}
debug: Failed to evaluate contract state! {"cacheKey":"9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY-5297cce89e5ff0c40dfefa35d96c1f8f2067e9956bdbc09a013966adebd3bd00","contractTxId":"9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","error":"Unable to retrieve tx npsNpXNps3wf0o15tQIW-AoXx7IBQbiURpwnWJhgdLk. 404. undefined","method":"GET","path":"/v1/contract/9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","timestamp":"2023-09-19T17:34:20.444Z","trace":"6b65b4"}
debug: Removing cached rqeuest from barrier map. {"cacheId":"9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY-5297cce89e5ff0c40dfefa35d96c1f8f2067e9956bdbc09a013966adebd3bd00","method":"GET","path":"/v1/contract/9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","timestamp":"2023-09-19T17:34:20.444Z","trace":"6b65b4"}
error: Failed to fetch contract {"contractTxId":"9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","error":"Unable to retrieve tx npsNpXNps3wf0o15tQIW-AoXx7IBQbiURpwnWJhgdLk. 404. undefined","method":"GET","path":"/v1/contract/9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","timestamp":"2023-09-19T17:34:20.445Z","trace":"6b65b4"}
debug: Setting cache-control to no-cache. {"method":"GET","path":"/v1/contract/9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","timestamp":"2023-09-19T17:34:20.446Z","trace":"6b65b4"}
debug: Completed request. {"method":"GET","path":"/v1/contract/9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","responseTime":"1400ms","timestamp":"2023-09-19T17:34:20.446Z","trace":"6b65b4"}
error: Uncaught exception! Unable to retrieve tx npsNpXNps3wf0o15tQIW-AoXx7IBQbiURpwnWJhgdLk. 404. undefined {"error":"Unable to retrieve tx npsNpXNps3wf0o15tQIW-AoXx7IBQbiURpwnWJhgdLk. 404. undefined","name":"NetworkCommunicationError","stack":"NetworkCommunicationError: Unable to retrieve tx npsNpXNps3wf0o15tQIW-AoXx7IBQbiURpwnWJhgdLk. 404. undefined\n    at /Users/dylanfiedler/Documents/ario/arns/pdns-service/node_modules/warp-contracts/src/utils/ArweaveWrapper.ts:79:15\n    at processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async ArweaveWrapper.tx (/Users/dylanfiedler/Documents/ario/arns/pdns-service/node_modules/warp-contracts/src/utils/ArweaveWrapper.ts:71:22)\n    at async ContractDefinitionLoader.loadContractSource (/Users/dylanfiedler/Documents/ario/arns/pdns-service/node_modules/warp-contracts/src/core/modules/impl/ContractDefinitionLoader.ts:97:27)\n    at async ContractDefinitionLoader.doLoad (/Users/dylanfiedler/Documents/ario/arns/pdns-service/node_modules/warp-contracts/src/core/modules/impl/ContractDefinitionLoader.ts:72:76)\n    at async ContractDefinitionLoader.load (/Users/dylanfiedler/Documents/ario/arns/pdns-service/node_modules/warp-contracts/src/core/modules/impl/ContractDefinitionLoader.ts:34:22)\n    at async HandlerBasedContract.createExecutionContext (/Users/dylanfiedler/Documents/ario/arns/pdns-service/node_modules/warp-contracts/src/contract/HandlerBasedContract.ts:543:28)\n    at async HandlerBasedContract.readState (/Users/dylanfiedler/Documents/ario/arns/pdns-service/node_modules/warp-contracts/src/contract/HandlerBasedContract.ts:165:32)","timestamp":"2023-09-19T17:34:20.468Z"}

After

info: Server is listening... {"keepAliveTimeout":120000,"port":3000,"requestTimeout":120000,"timestamp":"2023-09-19T17:33:28.409Z"}
debug: Fetching contract state {"contractTxId":"9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","method":"GET","path":"/v1/contract/9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","timestamp":"2023-09-19T17:33:33.954Z","trace":"c568b6"}
debug: Reading through to contract manifest... {"contractTxId":"9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","method":"GET","path":"/v1/contract/9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","timestamp":"2023-09-19T17:33:33.955Z","trace":"c568b6"}
debug: Reading through to contract state... {"cacheKey":"9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY-5297cce89e5ff0c40dfefa35d96c1f8f2067e9956bdbc09a013966adebd3bd00","contractTxId":"9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","method":"GET","path":"/v1/contract/9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","timestamp":"2023-09-19T17:33:34.473Z","trace":"c568b6"}
debug: Evaluating contract state... {"cacheKey":"9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY-5297cce89e5ff0c40dfefa35d96c1f8f2067e9956bdbc09a013966adebd3bd00","contractTxId":"9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","method":"GET","path":"/v1/contract/9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","timestamp":"2023-09-19T17:33:34.474Z","trace":"c568b6"}
debug: Failed to evaluate contract state! {"cacheKey":"9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY-5297cce89e5ff0c40dfefa35d96c1f8f2067e9956bdbc09a013966adebd3bd00","contractTxId":"9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","error":"Unable to retrieve tx npsNpXNps3wf0o15tQIW-AoXx7IBQbiURpwnWJhgdLk. 502. undefined","method":"GET","path":"/v1/contract/9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","timestamp":"2023-09-19T17:33:36.368Z","trace":"c568b6"}
debug: Removing cached rqeuest from barrier map. {"cacheId":"9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY-5297cce89e5ff0c40dfefa35d96c1f8f2067e9956bdbc09a013966adebd3bd00","method":"GET","path":"/v1/contract/9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","timestamp":"2023-09-19T17:33:36.368Z","trace":"c568b6"}
error: Failed to fetch contract {"contractTxId":"9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","error":"Unable to retrieve tx npsNpXNps3wf0o15tQIW-AoXx7IBQbiURpwnWJhgdLk. 502. undefined","method":"GET","path":"/v1/contract/9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","timestamp":"2023-09-19T17:33:36.369Z","trace":"c568b6"}
debug: Setting cache-control to no-cache. {"method":"GET","path":"/v1/contract/9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","timestamp":"2023-09-19T17:33:36.370Z","trace":"c568b6"}
debug: Completed request. {"method":"GET","path":"/v1/contract/9Uv9wmhL19qkBJnaQZJ9rM-b59JvIA82dBLA2SJK0GY","responseTime":"2419ms","timestamp":"2023-09-19T17:33:36.370Z","trace":"c568b6"}

@dtfiedler dtfiedler changed the title chore: testing an updating promise cache that does not away on puts fix(PE-4612): testing an updating promise cache that does not away on puts Sep 19, 2023
@dtfiedler dtfiedler marked this pull request as ready for review September 19, 2023 17:32
@dtfiedler dtfiedler requested a review from a team as a code owner September 19, 2023 17:32
src/api/warp.ts Outdated
});
})
.finally(() => {
logger?.debug('Removing cached rqeuest from barrier map.', {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
logger?.debug('Removing cached rqeuest from barrier map.', {
logger?.debug('Removing request from in-flight cache.', {

Copy link
Collaborator Author

@dtfiedler dtfiedler Sep 19, 2023

Choose a reason for hiding this comment

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

@dtfiedler dtfiedler changed the title fix(PE-4612): testing an updating promise cache that does not away on puts fix(PE-4612): testing an updating promise cache that does not await on puts Sep 19, 2023
@dtfiedler dtfiedler requested review from arielmelendez and a team September 19, 2023 17:54
@dtfiedler dtfiedler merged commit 024a0a0 into main Sep 19, 2023
7 checks passed
@dtfiedler dtfiedler deleted the checkout-uncaught branch September 19, 2023 18:10
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.

2 participants