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

Build with Erlang 21 #1396

Closed
nickva opened this issue Jun 20, 2018 · 9 comments
Closed

Build with Erlang 21 #1396

nickva opened this issue Jun 20, 2018 · 9 comments

Comments

@nickva
Copy link
Contributor

@nickva nickva commented Jun 20, 2018

Expected Behavior

CouchDB should build and run with Erlang 21

Current Behavior

Main repo and snappy dependency prevent building with Erlang 21

Also unit tests fails

Possible Solution

Update deps and fix tests

@nickva
Copy link
Contributor Author

@nickva nickva commented Jun 20, 2018

PR to update snappy to build with Erlang 21 apache/couchdb-snappy#7

@nickva
Copy link
Contributor Author

@nickva nickva commented Jun 20, 2018

Some failing unit tests

make eunit apps=couch_log
==> couch_log (compile)
==> rel (compile)
==> asf (compile)
==> asf (setup_eunit)
==> couch_log (eunit)
======================== EUnit ========================
module 'couch_log_util_test'
  couch_log_util_test: get_message_id_test...ok
  couch_log_util_test: level_to_atom_test...ok
  couch_log_util_test: string_p_test...ok
  [done in 0.009 s]
module 'couch_log_monitor'
module 'couch_log_writer_stderr_test'
  *** context setup failed ***
**in function gen:do_for_proc/2 (gen.erl, line 228)
in call from gen_event:rpc/2 (gen_event.erl, line 239)
in call from couch_log_test_util:remove_error_loggers/0 (test/couch_log_test_util.erl, line 128)
in call from couch_log_test_util:start/0 (test/couch_log_test_util.erl, line 21)
**exit:noproc


module 'couch_log_sup'
module 'couch_log_writer_file'
module 'couch_log_writer_test'
  *** context setup failed ***
**in function gen:do_for_proc/2 (gen.erl, line 228)
in call from gen_event:rpc/2 (gen_event.erl, line 239)
in call from couch_log_test_util:remove_error_loggers/0 (test/couch_log_test_util.erl, line 128)
in call from couch_log_test_util:start/0 (test/couch_log_test_util.erl, line 21)
**exit:noproc

@davisp
Copy link
Member

@davisp davisp commented Jun 21, 2018

I'll take a look at the couch_log test failures today.

@davisp
Copy link
Member

@davisp davisp commented Jun 21, 2018

Well this might have something to do with it:

OTP-13295    Application(s): erts, kernel, sasl, stdlib

               A new logging API is added to Erlang/OTP, see the
               logger(3) manual page, and section Logging in the
               Kernel User's Guide.

               Calls to error_logger are automatically redirected to
               the new API, and legacy error logger event handlers can
               still be used. It is, however, recommended to use the
               Logger API directly when writing new code.
@davisp
Copy link
Member

@davisp davisp commented Jun 21, 2018

Working through eunit failures. We'll need to merge this branch to mochiweb as well:

apache/couchdb-mochiweb@master...cloudant:fix-parameterized-module-errors

nickva added a commit to cloudant/couchdb that referenced this issue Jun 21, 2018
@davisp
Copy link
Member

@davisp davisp commented Jun 21, 2018

My unit test work is on this branch:

https://github.com/apache/couchdb/compare/fix-erlang-21-eunit-failures

Now getting errors from the test suite in couch and I have a hunch its related to the new fully async link/monitor/send primitives which aught to make fixing these super duper fun.

@davisp
Copy link
Member

@davisp davisp commented Jun 21, 2018

Also that's a dirty diff cause I wasn't careful about removing auto-whitespace trimmed hunks. Will clean it up later.

@davisp
Copy link
Member

@davisp davisp commented Jun 21, 2018

Also the async bullet point is this change:

OTP-14589    Application(s): erts

               Implementation of true asynchronous signaling between
               processes in order to improve scalability. Signals
               affected include exit, monitor, demonitor, monitor
               triggered, link, unlink, and group leader.
nickva added a commit that referenced this issue Jun 21, 2018
@davisp
Copy link
Member

@davisp davisp commented Jun 21, 2018

Also this change:

OTP-14901    Application(s): erts

               Optimized the common case of monitor followed by send
               to the same local process. The monitor signal is now
               delayed in order to be piggybacked with the sent
               message and thereby only get one lock operation on the
               message queue of the receiver. A delayed monitor signal
               is flushed if no send has been done at the latest when
               the process is scheduled out.
nickva added a commit to cloudant/couchdb that referenced this issue Jun 22, 2018
During 21.0 testing, the hack to read extra data from the socket to give the
client a better chance of detecting a 413 response ended up failing. Either
process scheduling or IO scheduling was different enough that the test started
failing fairly consistently.

Apply a better fix that's more in-line with the intent -- after responding to
the client with a 413, read a limited amount of data off the socket (1MB).
Limit the maximum time spent doing it to less than 1 second.

Issue apache#1396
nickva added a commit that referenced this issue Jun 22, 2018
During 21.0 testing, the hack to read extra data from the socket to give the
client a better chance of detecting a 413 response ended up failing. Either
process scheduling or IO scheduling was different enough that the test started
failing fairly consistently.

Apply a better fix that's more in-line with the intent -- after responding to
the client with a 413, read a limited amount of data off the socket (1MB).
Limit the maximum time spent doing it to less than 1 second.

Issue #1396
nickva added a commit to cloudant/couchdb that referenced this issue Jun 22, 2018
Issue apache#1396
nickva added a commit to cloudant/couchdb that referenced this issue Jun 22, 2018
Issue apache#1396
davisp added a commit that referenced this issue Jun 22, 2018
nickva added a commit that referenced this issue Oct 3, 2018
During 21.0 testing, the hack to read extra data from the socket to give the
client a better chance of detecting a 413 response ended up failing. Either
process scheduling or IO scheduling was different enough that the test started
failing fairly consistently.

Apply a better fix that's more in-line with the intent -- after responding to
the client with a 413, read a limited amount of data off the socket (1MB).
Limit the maximum time spent doing it to less than 1 second.

Issue #1396
nickva added a commit that referenced this issue Oct 3, 2018
During 21.0 testing, the hack to read extra data from the socket to give the
client a better chance of detecting a 413 response ended up failing. Either
process scheduling or IO scheduling was different enough that the test started
failing fairly consistently.

Apply a better fix that's more in-line with the intent -- after responding to
the client with a 413, read a limited amount of data off the socket (1MB).
Limit the maximum time spent doing it to less than 1 second.

Issue #1396
nickva added a commit that referenced this issue Oct 4, 2018
This is a temporary bandaid to allow us to continue using parameterized
modules with Erlang 21. We'll have to go back and modify every one of
these files to avoid that as well as figuring out how to upgrade
mochiweb to something that doesn't use parameterized modules by the time
they are fully removed from Erlang.

Fixes #1396
nickva added a commit that referenced this issue Oct 4, 2018
nickva added a commit that referenced this issue Oct 4, 2018
This can now return references that are from NIFs monitoring the
process. This is important for the new file IO NIFs that monitor the
controlling process. For now we'll just take the easy way out by
filtering the references from our returned monitor lists.

Fixes #1396
nickva added a commit that referenced this issue Oct 4, 2018
Fixes #1396
nickva added a commit that referenced this issue Oct 4, 2018
This can now return references that are from NIFs monitoring the
process. This is important for the new file IO NIFs that monitor the
controlling process. For now we'll just take the easy way out by
filtering the references from our returned monitor lists.

Fixes #1396
nickva added a commit that referenced this issue Oct 4, 2018
Fixes #1396
nickva added a commit that referenced this issue Oct 4, 2018
This can now return references that are from NIFs monitoring the
process. This is important for the new file IO NIFs that monitor the
controlling process. For now we'll just take the easy way out by
filtering the references from our returned monitor lists.

Fixes #1396
nickva added a commit that referenced this issue Oct 4, 2018
Fixes #1396
@nickva nickva closed this in #1640 Oct 4, 2018
nickva added a commit that referenced this issue Oct 4, 2018
This is a temporary bandaid to allow us to continue using parameterized
modules with Erlang 21. We'll have to go back and modify every one of
these files to avoid that as well as figuring out how to upgrade
mochiweb to something that doesn't use parameterized modules by the time
they are fully removed from Erlang.

Fixes #1396
nickva added a commit that referenced this issue Oct 4, 2018
nickva added a commit that referenced this issue Oct 4, 2018
This can now return references that are from NIFs monitoring the
process. This is important for the new file IO NIFs that monitor the
controlling process. For now we'll just take the easy way out by
filtering the references from our returned monitor lists.

Fixes #1396
nickva added a commit that referenced this issue Oct 4, 2018
Fixes #1396
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants