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

feat(couchjs): add support for SpiderMonkey 91esr #3842

Merged
merged 2 commits into from
Dec 2, 2021

Conversation

lostnet
Copy link
Contributor

@lostnet lostnet commented Nov 22, 2021

Overview

This PR introduces spidermonkey 91esr. As with 78 and 86 there are no relevant API changes but it became necessary in practice as well as in theory to destroy the context and shutdown JS before any proper exit to prevent assertions in destructors. (For more information, the issue tracking the esr91 migration guide is here

Testing recommendations

Since many distributions don't ship with moz-js 91 yet, I've included a github workflow to test couchdb in ubuntu with the latest spidermonkey, foundationdb 6.x, and icu. It is set to be manually run on a branch from the actions menu.

Related Issues or Pull Requests

Checklist

Footnotes

  1. no configurable parameters for runtime

  2. spidermonkey versions are only referenced in whatsnew for release branches.

@lostnet
Copy link
Contributor Author

lostnet commented Nov 23, 2021

I don't see how the erlfdb test failure relates to the PR. If this is from fdb errors it is key_outside_legal_range which apparently could make sense with a random key since some keys are special but it is highly unlikely to happen with multiple runs if they are getting different random seeds? (I think I misread the results and the error seems to only have occur in one actual 23.3.1 run.)

@nickva
Copy link
Contributor

nickva commented Nov 23, 2021

@lostnet Thanks for your contribution!

I believe you just hit a spurious bug in erlfdb. That when we generate random keys and value to add but forgot guard against writing to \xFF range.

I had created an issue to fix it apache/couchdb-erlfdb#46

Re-triggered your PR and now it passed

Copy link
Member

@kocolosk kocolosk left a comment

Choose a reason for hiding this comment

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

Thanks for this contribution! It seems like we might need to modify some project configuration for the Action to show up, but I don't want that to block the merge of this PR.

@@ -330,7 +330,7 @@ void
couch_oom(JSContext* cx, void* data)
{
fprintf(stderr, "out of memory\n");
exit(1);
_Exit(1);
Copy link
Member

Choose a reason for hiding this comment

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

Is this change something that ought to be backported to our wrappers for older versions of SpiderMonkey, or is it motivated by something specific in ESR91?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is a little of both something that changed and a bug that existed.. Technically it was never correct to do a proper exit() without cleaning up the js context which we can't do in the middle of being called from the js context (and having a shortage of memory its risky to assume we can get a chance to exit later), but it was only in recent versions that mozilla added destructors that notice they are being called with a still active context.

Since it was a bug I saw no problem with keeping it combined and fixing 86 and 78 in the process, but none of the earlier versions should ever get patches again so it probably doesn't need to be backported to the earlier wrappers.

@kocolosk kocolosk merged commit cb6aff4 into apache:main Dec 2, 2021
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.

3 participants