History log of /unit/src/ruby/nxt_ruby.c (Results 1 – 25 of 27)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 2087:ce43da300a31 09-Mar-2022 Zhidao HONG

Ruby: added the Rack environment parameter "SCRIPT_NAME".


Revision tags: 1.26.1-1, 1.26.1, 1.26.0-1, 1.26.0
# 1980:43553aa72111 28-Oct-2021 Max Romanov

Moving request limit control to libunit.

Introducting application graceful stop. For now only used when application
process reach request limit value.

This closes #585 issue on GitHub.


Revision tags: 1.25.0-1, 1.25.0
# 1910:b9e844d85f21 02-Jul-2021 Oisin Canty

Ruby: process and thread lifecycle hooks.

This feature allows one to specify blocks of code that are called when certain
lifecycle events occur. A user configures a "hooks" property on the app
conf

Ruby: process and thread lifecycle hooks.

This feature allows one to specify blocks of code that are called when certain
lifecycle events occur. A user configures a "hooks" property on the app
configuration that points to a script. This script will be evaluated on boot
and should contain blocks of code that will be called on specific events.

An example of configuration:

{
"type": "ruby",
"processes": 2,
"threads": 2,
"user": "vagrant",
"group": "vagrant",
"script": "config.ru",
"hooks": "hooks.rb",
"working_directory": "/home/vagrant/unit/rbhooks",
"environment": {
"GEM_HOME": "/home/vagrant/.ruby"
}
}

An example of a valid "hooks.rb" file follows:

File.write("./hooks.#{Process.pid}", "hooks evaluated")

on_worker_boot do
File.write("./worker_boot.#{Process.pid}", "worker booted")
end

on_thread_boot do
File.write("./thread_boot.#{Process.pid}.#{Thread.current.object_id}",
"thread booted")
end

on_thread_shutdown do
File.write("./thread_shutdown.#{Process.pid}.#{Thread.current.object_id}",
"thread shutdown")
end

on_worker_shutdown do
File.write("./worker_shutdown.#{Process.pid}", "worker shutdown")
end

This closes issue #535 on GitHub.

show more ...


# 1905:d66a5f909497 01-Jul-2021 Oisin Canty

Ruby: improved logging of exceptions without backtraces.

If an exception was raised with a backtrace of zero length, the
nxt_ruby_exception_log() routine would return without logging the
exception c

Ruby: improved logging of exceptions without backtraces.

If an exception was raised with a backtrace of zero length, the
nxt_ruby_exception_log() routine would return without logging the
exception class and message. This commit fixes the issue.

show more ...


Revision tags: 1.24.0-1, 1.24.0, 1.23.0-1, 1.23.0
# 1814:05a8e3eb6244 15-Mar-2021 Valentin Bartenev

Ruby: fixed encodings initialization.

The Ruby interpreter expects an explicit setlocale() call before initialization
to pick up character encodings in the "Encoding" class from the environment.

Th

Ruby: fixed encodings initialization.

The Ruby interpreter expects an explicit setlocale() call before initialization
to pick up character encodings in the "Encoding" class from the environment.

This closes #531 issue on GitHub.

show more ...


Revision tags: 1.22.0-1, 1.22.0
# 1738:4a7bb9e7678a 07-Dec-2020 Max Romanov

Ruby: fixed crash on thread start.

Ruby threads need to be created with GVL; otherwise, an attempt to access
locked resources may occur, causing a crash.

The issue was occasionally reproduced on Ub

Ruby: fixed crash on thread start.

Ruby threads need to be created with GVL; otherwise, an attempt to access
locked resources may occur, causing a crash.

The issue was occasionally reproduced on Ubuntu 18.04 with Ruby 2.5.1
while running test_ruby_application_threads.

show more ...


Revision tags: 1.21.0-1, 1.21.0
# 1691:a9d23e41c19b 05-Nov-2020 Max Romanov

Ruby: error checking during thread creation.

Application terminates in case of thread creation failure.


# 1687:b9d99e596725 04-Nov-2020 Max Romanov

Ruby: request processing in multiple threads.

This closes #482 issue on GitHub.


# 1686:9f31e1ab6c19 04-Nov-2020 Max Romanov

Ruby: reusing static constant references to string objects.

This shall save a couple of CPU cycles in request processing.


Revision tags: 1.20.0-1, 1.20.0, 1.19.0-1, 1.19.0
# 1532:4b4d0c3ce94b 30-Jul-2020 Tiago Natel de Moura

Isolation: fixed the generation of mounts table.

Since the introduction of rootfs feature, some language modules
can't be configured multiple times.

Now the configure generates a separate nxt_<modu

Isolation: fixed the generation of mounts table.

Since the introduction of rootfs feature, some language modules
can't be configured multiple times.

Now the configure generates a separate nxt_<module>_mounts.h for
each module compiled.

show more ...


# 1503:c21230ef5a0e 22-Jun-2020 Tiago Natel de Moura

Isolation: fixed build when features aren't detected.


Revision tags: 1.18.0-1, 1.18.0
# 1489:4a3ec07f4b19 28-May-2020 Tiago Natel de Moura

Added "rootfs" feature.


# 1488:6976d36be926 09-Mar-2020 Tiago Natel de Moura

Refactor of process management.

The process abstraction has changed to:

setup(task, process)
start(task, process_data)
prefork(task, process, mp)

The prefork() occurs in the main process rig

Refactor of process management.

The process abstraction has changed to:

setup(task, process)
start(task, process_data)
prefork(task, process, mp)

The prefork() occurs in the main process right before fork.

The file src/nxt_main_process.c is completely free of process
specific logic.

The creation of a process now supports a PROCESS_CREATED state. The
The setup() function of each process can set its state to either
created or ready. If created, a MSG_PROCESS_CREATED is sent to main
process, where external setup can be done (required for rootfs under
container).

The core processes (discovery, controller and router) doesn't need
external setup, then they all proceeds to their start() function
straight away.

In the case of applications, the load of the module happens at the
process setup() time and The module's init() function has changed
to be the start() of the process.

The module API has changed to:

setup(task, process, conf)
start(task, data)

As a direct benefit of the PROCESS_CREATED message, the clone(2) of
processes using pid namespaces now doesn't need to create a pipe
to make the child block until parent setup uid/gid mappings nor it
needs to receive the child pid.

show more ...


Revision tags: 1.17.0-1, 1.17.0, 1.16.0-1, 1.16.0, 1.15.0-1, 1.15.0
# 1337:2200adad4885 28-Jan-2020 Max Romanov

Ruby: changing callback functions prototype for v2.7.

This closes #371 issue on GitHub.


Revision tags: 1.14.0-1, 1.14.0
# 1320:4e70411b9842 24-Dec-2019 Max Romanov

Adding "limits/shm" configuration validation and parsing.


Revision tags: 1.13.0-1, 1.13.0
# 1258:f396f2421319 13-Nov-2019 Max Romanov

Ruby: fixing initialization sequence.

There was a change (ruby/ruby@6c70fed) in Ruby 2.6 that moved
RUBY_DESCRIPTION global constant definition out of Init_version().
Unit initialized Ruby incorrect

Ruby: fixing initialization sequence.

There was a change (ruby/ruby@6c70fed) in Ruby 2.6 that moved
RUBY_DESCRIPTION global constant definition out of Init_version().
Unit initialized Ruby incorrectly, so the constant was not defined.

This closes #330 issue on GitHub.

show more ...


Revision tags: 1.12.0-1, 1.12.0, 1.11.0-2, 1.11.0-1, 1.11.0, 1.10.0-2, 1.10.0-1, 1.10.0, 1.9.0-1, 1.9.0
# 1011:0c41674ec79c 21-Mar-2019 Max Romanov

Adjusting request schema value according to connection tls state.

This closes #223 issue on GitHub.


Revision tags: 1.8.0-1, 1.8.0
# 981:e9253a35f47a 28-Feb-2019 Valentin Bartenev

Made QUERY_STRING mandatory.

According to CGI/1.1 RFC 3875:

The server MUST set this variable; if the Script-URI does not include a
query component, the QUERY_STRING MUST be defined as an emp

Made QUERY_STRING mandatory.

According to CGI/1.1 RFC 3875:

The server MUST set this variable; if the Script-URI does not include a
query component, the QUERY_STRING MUST be defined as an empty string ("").

Python's PEP 333(3) allows omitting it in WSGI interface; PHP docs force no
requirements; PSGI and Rack specifications require it even if empty.

When nginx proxies requests over FastCGI, it always provides QUERY_STRING.
and some PHP apps have been observed to fail if it is missing (see issue
#201 on GitHub).

A drawback of this change (besides a small overhead) is that there will be
no easy way to tell a missing query string from an empty one (i.e. requests
with or without the "?" character); yet, it's negligible compared to the
possible benefits of wider application compatibility.

This closes #226 issue on GitHub.

show more ...


# 977:4f9268f27b57 28-Feb-2019 Max Romanov

Introducing Java Servlet Container beta.


# 967:d693ed6d0209 27-Feb-2019 Valentin Bartenev

Fixed processing of SERVER_NAME after 77aad2c142a0.

Previously, the nxt_router_prepare_msg() function expected server host among
other headers unmodified. It's not true anymore since normalization

Fixed processing of SERVER_NAME after 77aad2c142a0.

Previously, the nxt_router_prepare_msg() function expected server host among
other headers unmodified. It's not true anymore since normalization of the
Host header has been introduced in 77aad2c142a0.

The nxt_unit_split_host() function was removed. It didn't work correctly with
IPv6 literals. Anyway, after 77aad2c142a0 the port splitting is done in router
while Host header processing.

show more ...


Revision tags: 1.7.1-1, 1.7.1, 1.7-1, 1.7, 1.6-1, 1.6, 1.5-1, 1.5, 1.4-2, 1.4
# 743:e0f0cd7d244a 06-Aug-2018 Max Romanov

Unit application library.

Library now used in all language modules.
Old 'nxt_app_*' code removed.

See src/test/nxt_unit_app_test.c for usage sample.


Revision tags: 1.3
# 717:f8e279782e5e 10-Jul-2018 Alexander Borisov

Ruby: added "require('bundler/setup')".

This closes #93 PR on GitHub.


# 703:2d536dde84d2 25-Jun-2018 Valentin Bartenev

Introduced nxt_length() macro.


Revision tags: 1.2
# 673:9fa79c719a17 21-May-2018 Valentin Bartenev

Added SERVER_SOFTWARE request meta-variable.


Revision tags: 1.1, 1.0
# 612:217e48a3b091 04-Apr-2018 Alexander Borisov

Changed version processing for modules.


12