<feed xmlns='http://www.w3.org/2005/Atom'>
<title>unit.git/src/ruby, branch 1.27.0</title>
<subtitle>Universal Web Application Server</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/'/>
<entry>
<title>Ruby: added stream IO "close" required by Rack specification.</title>
<updated>2022-05-13T11:33:40+00:00</updated>
<author>
<name>Zhidao HONG</name>
<email>z.hong@f5.com</email>
</author>
<published>2022-05-13T11:33:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=5883a2670fbeb1610014ec122a5fd20312399a90'/>
<id>5883a2670fbeb1610014ec122a5fd20312399a90</id>
<content type='text'>
This closes #654 issue on Github.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This closes #654 issue on Github.
</pre>
</div>
</content>
</entry>
<entry>
<title>Ruby: added the Rack environment parameter "SCRIPT_NAME".</title>
<updated>2022-03-09T05:29:43+00:00</updated>
<author>
<name>Zhidao HONG</name>
<email>z.hong@f5.com</email>
</author>
<published>2022-03-09T05:29:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=0032543fa65f454c471c968998190b027c1ff270'/>
<id>0032543fa65f454c471c968998190b027c1ff270</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Moving request limit control to libunit.</title>
<updated>2021-10-28T14:46:54+00:00</updated>
<author>
<name>Max Romanov</name>
<email>max.romanov@nginx.com</email>
</author>
<published>2021-10-28T14:46:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=bba97134e983541e94cf73e93900729e3a3e61fc'/>
<id>bba97134e983541e94cf73e93900729e3a3e61fc</id>
<content type='text'>
Introducting application graceful stop.  For now only used when application
process reach request limit value.

This closes #585 issue on GitHub.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introducting application graceful stop.  For now only used when application
process reach request limit value.

This closes #585 issue on GitHub.
</pre>
</div>
</content>
</entry>
<entry>
<title>Ruby: process and thread lifecycle hooks.</title>
<updated>2021-07-02T12:57:55+00:00</updated>
<author>
<name>Oisin Canty</name>
<email>o.canty@f5.com</email>
</author>
<published>2021-07-02T12:57:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=655e321075c0beebe14eba83deeac1ba4c9e0b29'/>
<id>655e321075c0beebe14eba83deeac1ba4c9e0b29</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Ruby: improved logging of exceptions without backtraces.</title>
<updated>2021-07-01T11:16:43+00:00</updated>
<author>
<name>Oisin Canty</name>
<email>o.canty@f5.com</email>
</author>
<published>2021-07-01T11:16:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=830729a6c5a59615d611575c22516b0fb9dcab3d'/>
<id>830729a6c5a59615d611575c22516b0fb9dcab3d</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Ruby: changing deprecated rb_cData to rb_cObject.</title>
<updated>2021-05-18T10:14:43+00:00</updated>
<author>
<name>Oisin Canty</name>
<email>o.canty@f5.com</email>
</author>
<published>2021-05-18T10:14:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=ead6ed999a87fac6fc9ad3f4f94a6cec1d287b5e'/>
<id>ead6ed999a87fac6fc9ad3f4f94a6cec1d287b5e</id>
<content type='text'>
Ruby 3.0 deprecated rb_cData with the intention to remove it in release 3.1.
This commit changes references of rb_cData to rb_cObject.  This was done so we
can support distributions that package Ruby 3.0, such as Fedora 34.

We also need to call rb_undef_alloc_func because we're no longer deriving from
rb_cData.  This prevents unnecessary allocations.

See:
https://docs.ruby-lang.org/en/3.0.0/doc/extension_rdoc.html

"It is recommended that klass derives from a special class called Data
(rb_cData) but not from Object or other ordinal classes.  If it doesn't,
you have to call rb_undef_alloc_func(klass)."
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ruby 3.0 deprecated rb_cData with the intention to remove it in release 3.1.
This commit changes references of rb_cData to rb_cObject.  This was done so we
can support distributions that package Ruby 3.0, such as Fedora 34.

We also need to call rb_undef_alloc_func because we're no longer deriving from
rb_cData.  This prevents unnecessary allocations.

See:
https://docs.ruby-lang.org/en/3.0.0/doc/extension_rdoc.html

"It is recommended that klass derives from a special class called Data
(rb_cData) but not from Object or other ordinal classes.  If it doesn't,
you have to call rb_undef_alloc_func(klass)."
</pre>
</div>
</content>
</entry>
<entry>
<title>Ruby: fixed encodings initialization.</title>
<updated>2021-03-15T12:03:32+00:00</updated>
<author>
<name>Valentin Bartenev</name>
<email>vbart@nginx.com</email>
</author>
<published>2021-03-15T12:03:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=4c261a7ff8f2b2af08cc2cdee6828af4a1cf7794'/>
<id>4c261a7ff8f2b2af08cc2cdee6828af4a1cf7794</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Ruby: fixed crash on thread start.</title>
<updated>2020-12-07T18:17:25+00:00</updated>
<author>
<name>Max Romanov</name>
<email>max.romanov@nginx.com</email>
</author>
<published>2020-12-07T18:17:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=d3796d1fb7008629a8fa505481dab96efe60cbdb'/>
<id>d3796d1fb7008629a8fa505481dab96efe60cbdb</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>Ruby: error checking during thread creation.</title>
<updated>2020-11-05T14:02:55+00:00</updated>
<author>
<name>Max Romanov</name>
<email>max.romanov@nginx.com</email>
</author>
<published>2020-11-05T14:02:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=2220b8258f116d12f9cf6eb4133f41ec374b75f5'/>
<id>2220b8258f116d12f9cf6eb4133f41ec374b75f5</id>
<content type='text'>
Application terminates in case of thread creation failure.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Application terminates in case of thread creation failure.
</pre>
</div>
</content>
</entry>
<entry>
<title>Ruby: request processing in multiple threads.</title>
<updated>2020-11-05T09:45:10+00:00</updated>
<author>
<name>Max Romanov</name>
<email>max.romanov@nginx.com</email>
</author>
<published>2020-11-05T09:45:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=b6475df79cd14d80c794abfc9d1edbcebbe86f2c'/>
<id>b6475df79cd14d80c794abfc9d1edbcebbe86f2c</id>
<content type='text'>
This closes #482 issue on GitHub.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This closes #482 issue on GitHub.
</pre>
</div>
</content>
</entry>
</feed>
