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

Do not return broken processes to the query process pool #3329

Merged
merged 1 commit into from Jan 15, 2021

Conversation

nickva
Copy link
Contributor

@nickva nickva commented Jan 15, 2021

Previously, if an error was thrown in a with_ddoc_proc/2 callback, the process was still returned to the process pool in the after clause. However, in some cases, for example when processing a _list response, the process might
end up stuck in a bad state state, such that it could not be re-used anymore. In such a case, a subsequent user of that couch_js process would end up throwing an error and crashing.

Fixes #2962

Checklist

  • Code is written and works correctly
  • Changes are covered by tests
  • Any new configurable parameters are documented in rel/overlay/etc/default.ini
  • A PR for documentation changes has been made in https://github.com/apache/couchdb-documentation

Copy link
Member

@davisp davisp left a comment

Choose a reason for hiding this comment

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

Couple tweaks to the test but otherwise looks good!

src/couch/test/eunit/couchdb_os_proc_pool.erl Show resolved Hide resolved
src/couch/test/eunit/couchdb_os_proc_pool.erl Outdated Show resolved Hide resolved
Previously, if an error was thrown in a `with_ddoc_proc/2` callback, the
process was still returned to the process pool in the `after` clause. However,
in some cases, for example when processing a _list response, the process might
end up stuck in a bad state state, such that it could not be re-used anymore.
In such a case, a subsequent user of that couch_js process would end up
throwing an error and crashing.

Fixes #2962
@nickva nickva force-pushed the do_not_return_bad_os_processes_into_the_pool branch from 3c51d95 to 6d263ae Compare January 15, 2021 19:03
Copy link
Member

@davisp davisp left a comment

Choose a reason for hiding this comment

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

+1

@nickva nickva merged commit 9231824 into 3.x Jan 15, 2021
@nickva nickva deleted the do_not_return_bad_os_processes_into_the_pool branch January 15, 2021 21:19
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

2 participants