Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "near-vm: use a recycling pool of shared code memories instead of a in-memory cache of loaded artifacts (#9244)" #10788

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

nagisa
Copy link
Collaborator

@nagisa nagisa commented Mar 13, 2024

This reverts commit ad67e6b.

… of a in-memory cache of loaded artifacts (near#9244)"

This reverts commit ad67e6b.
@nagisa nagisa requested a review from a team as a code owner March 13, 2024 21:14
@nagisa nagisa requested review from wacban and removed request for a team March 13, 2024 21:14
@nagisa nagisa changed the title Revert "near-vm: use a recycling pool of shared code memories insteadof a in-memory cache of loaded artifacts (#9244)" Revert "near-vm: use a recycling pool of shared code memories instead of a in-memory cache of loaded artifacts (#9244)" Mar 13, 2024
Copy link
Contributor

@wacban wacban left a comment

Choose a reason for hiding this comment

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

I have absolutely not clue what I'm doing but approving to unblock and since it was discussed at length on zulip. If there is anyone more familiar with this code you may want to have it reviewed by them.

.map_err(|_| CacheError::DeserializationError)?;
let artifact = self

let compile_or_read_from_cache = || -> VMResult<Result<VMArtifact, CompilationError>> {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: best move to a dedicated method, both this closure and the compile_and_load are too long already


let stored_artifact: Option<VMArtifact> = match cache_record {
None => None,
Some(CompiledContract::CompileModuleError(err)) => return Ok(Err(err)),
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah yes, the "operation failed successfully" return :)

Comment on lines +384 to +388
#[cfg(feature = "no_cache")]
return compile_or_read_from_cache();

#[cfg(not(feature = "no_cache"))]
return {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to do that on method level? It would be more readable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I would rather not modify this code at all given that it is legacy and there's no benefit to taking the risk IMO.

@nagisa nagisa merged commit bb02713 into near:1.38.0 Mar 14, 2024
11 of 16 checks passed
@nagisa nagisa deleted the revert-limited-memory-pool-1.38 branch March 14, 2024 15:30
@wacban
Copy link
Contributor

wacban commented Mar 14, 2024

@nagisa Not sure what happened but it seems like some important checks failed. Can you check what is going on? e.g. cargo nextest (Linux)

posvyatokum pushed a commit that referenced this pull request Mar 14, 2024
… of a in-memory cache of loaded artifacts (#9244)" (#10788)

This reverts commit ad67e6b.
@nagisa
Copy link
Collaborator Author

nagisa commented Mar 14, 2024

There's nothing much to look into here -- this PR/commit targets 1.38 branch and these branches just never pass the CI.

@wacban
Copy link
Contributor

wacban commented Mar 14, 2024

I don't think that's the case but I had a look at the failures and it's just clippy and themis so not too bad.

@nagisa
Copy link
Collaborator Author

nagisa commented Mar 15, 2024

I don't think that's the case

That's how it is today unfortunately. Before this PR the CI couldn't possibly pass due to justfile containing merge conflict markers, for example. But even then, themis could never pass because its checks actively conflict with the release procedure. And as a result nobody really looks at those checks. This is an unfortunate place to be, but this is where we are.

cc @Ekleog-NEAR an idea for a CI related project -- make it enforced that the releases must pass the CI too :) The fact that we release of a branch that can't pass the tests (even if it wanted to) is a landmine waiting to be stepped on.

@wacban
Copy link
Contributor

wacban commented Mar 15, 2024

Ah it must be a new thing, I fixed some old issue on the release branch about a year ago. I think it was sufficient to override the protocol voting date for CI. Yeah to be honest we should have green CI for release branch and if we can enforce that it would be even better.

@wacban
Copy link
Contributor

wacban commented Mar 15, 2024

@nagisa Just sanity checking, will you be also merging it to master?

@nagisa
Copy link
Collaborator Author

nagisa commented Mar 15, 2024 via email

nagisa added a commit to nagisa/nearcore that referenced this pull request Mar 20, 2024
…d of a in-memory cache of loaded artifacts (near#9244)" (near#10788)

This reverts commit bb02713.
VanBarbascu pushed a commit that referenced this pull request Mar 26, 2024
…d of a in-memory cache of loaded artifacts (#9244)" (#10788)

This reverts commit bb02713.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants