<feed xmlns='http://www.w3.org/2005/Atom'>
<title>unit.git/src/wasm-wasi-component, branch 1.33.0</title>
<subtitle>Universal Web Application Server</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/'/>
<entry>
<title>wasm-wc: Enable environment inheritance</title>
<updated>2024-09-04T21:50:59+00:00</updated>
<author>
<name>Robbie McKinstry</name>
<email>thesnowmancometh@gmail.com</email>
</author>
<published>2024-08-28T02:00:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=56c237b347fd0ff3fa182663cbc965e05b158e39'/>
<id>56c237b347fd0ff3fa182663cbc965e05b158e39</id>
<content type='text'>
While the C based wasm language module inherits the process environment
the Rust based wasm-wasi-component language module did not.

One upshot of this is that with wasm-wasi-component you don't get access
to any environment variables specified in the Unit configuration.

wasm-wasi-component was based on wasmtime 17.0.0. This capability wasn't
added to the wasmtime-crate until version 20.0.0.

Now that wasm-wasi-component has been updated to a newer wasmtime-crate
we can enable this functionality.

Closes: https://github.com/nginx/unit/issues/1312
[ Commit message - Andrew ]
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While the C based wasm language module inherits the process environment
the Rust based wasm-wasi-component language module did not.

One upshot of this is that with wasm-wasi-component you don't get access
to any environment variables specified in the Unit configuration.

wasm-wasi-component was based on wasmtime 17.0.0. This capability wasn't
added to the wasmtime-crate until version 20.0.0.

Now that wasm-wasi-component has been updated to a newer wasmtime-crate
we can enable this functionality.

Closes: https://github.com/nginx/unit/issues/1312
[ Commit message - Andrew ]
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>wasm-wc: bump wasmtime to v24</title>
<updated>2024-09-04T21:50:59+00:00</updated>
<author>
<name>Ava Hahn</name>
<email>a.hahn@f5.com</email>
</author>
<published>2024-08-28T19:50:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=011071aaa1809f63abdc4287c80843c8d6e7e179'/>
<id>011071aaa1809f63abdc4287c80843c8d6e7e179</id>
<content type='text'>
Signed-off-by: Ava Hahn &lt;a.hahn@f5.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Ava Hahn &lt;a.hahn@f5.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>wasm-wc: Bump the rustls crate from 0.21.10 to 0.21.11</title>
<updated>2024-04-19T21:30:49+00:00</updated>
<author>
<name>dependabot[bot]</name>
<email>49699333+dependabot[bot]@users.noreply.github.com</email>
</author>
<published>2024-04-19T19:54:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=237a26aafc4f2572668d0063228929f482073691'/>
<id>237a26aafc4f2572668d0063228929f482073691</id>
<content type='text'>
Bumps &lt;https://github.com/rustls/rustls&gt; from 0.21.10 to 0.21.11.

"This release corrects a denial-of-service condition in
rustls::ConnectionCommon::complete_io(), reachable via network input. If
a close_notify alert is received during a handshake, complete_io() did
not terminate. Callers which do not call complete_io() are not
affected."

The wasm-wasi-component language module is not effected by this as it
doesn't handle client connections, Unit does.

Link: Release notes &lt;https://github.com/rustls/rustls/releases&gt;
Link: Commits &lt;https://github.com/rustls/rustls/compare/v/0.21.10...v/0.21.11&gt;
Signed-off-by: dependabot[bot] &lt;support@github.com&gt;
Reviewed-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
[ Tweaked commit message/subject - Andrew ]
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bumps &lt;https://github.com/rustls/rustls&gt; from 0.21.10 to 0.21.11.

"This release corrects a denial-of-service condition in
rustls::ConnectionCommon::complete_io(), reachable via network input. If
a close_notify alert is received during a handshake, complete_io() did
not terminate. Callers which do not call complete_io() are not
affected."

The wasm-wasi-component language module is not effected by this as it
doesn't handle client connections, Unit does.

Link: Release notes &lt;https://github.com/rustls/rustls/releases&gt;
Link: Commits &lt;https://github.com/rustls/rustls/compare/v/0.21.10...v/0.21.11&gt;
Signed-off-by: dependabot[bot] &lt;support@github.com&gt;
Reviewed-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
[ Tweaked commit message/subject - Andrew ]
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Wasm-wc: Bump the h2 crate from 0.4.2 to 0.4.4</title>
<updated>2024-04-09T02:15:35+00:00</updated>
<author>
<name>dependabot[bot]</name>
<email>49699333+dependabot[bot]@users.noreply.github.com</email>
</author>
<published>2024-04-05T15:08:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=d494d2ebb71ab45781ec7c8cf8b80e6892ce65a8'/>
<id>d494d2ebb71ab45781ec7c8cf8b80e6892ce65a8</id>
<content type='text'>
Bumps h2 &lt;https://github.com/hyperium/h2&gt; from 0.4.2 to 0.4.4.

Limit number of CONTINUATION frames for misbehaving connections.

Link: Changelog &lt;https://github.com/hyperium/h2/blob/master/CHANGELOG.md&gt;
Link: Commits &lt;https://github.com/hyperium/h2/compare/v0.4.2...v0.4.4&gt;
Signed-off-by: dependabot[bot] &lt;support@github.com&gt;
Reviewed-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
[ Tweaked commit message/subject - Andrew ]
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bumps h2 &lt;https://github.com/hyperium/h2&gt; from 0.4.2 to 0.4.4.

Limit number of CONTINUATION frames for misbehaving connections.

Link: Changelog &lt;https://github.com/hyperium/h2/blob/master/CHANGELOG.md&gt;
Link: Commits &lt;https://github.com/hyperium/h2/compare/v0.4.2...v0.4.4&gt;
Signed-off-by: dependabot[bot] &lt;support@github.com&gt;
Reviewed-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
[ Tweaked commit message/subject - Andrew ]
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Wasm-wc: Fix application restarts</title>
<updated>2024-03-14T16:09:31+00:00</updated>
<author>
<name>Andrew Clayton</name>
<email>a.clayton@nginx.com</email>
</author>
<published>2024-03-07T16:16:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=e75f8d5db200c77707478b558c3ce5e1586ab3e1'/>
<id>e75f8d5db200c77707478b558c3ce5e1586ab3e1</id>
<content type='text'>
Liam reported a problem when trying to restart wasm-wasi-component based
applications using the /control/applications/APPLICATION_NAME/restart
endpoint.

The application would become unresponsive.

What was happening was the old application process(es) weren't
exit(3)ing and so while we were starting new application processes, the
old ones were still hanging around in a non-functioning state.

When we are terminating an application it must call exit(3).

So that's what we do. We use the return value of nxt_unit_run() as the
exit status.

Due to exit(3)ing we also need to now explicitly handle the return on
error case.

Reported-by: Liam Crilly &lt;liam@nginx.com&gt;
Fixes: 20ada4b5c ("Wasm-wc: Core of initial Wasm component model language module support")
Closes: https://github.com/nginx/unit/issues/1179
Tested-by: Liam Crilly &lt;liam@nginx.com&gt;
Tested-by: Danielle De Leo &lt;d.deleo@f5.com&gt;
Co-developed-by: Dan Callahan &lt;d.callahan@f5.com&gt;
Signed-off-by: Dan Callahan &lt;d.callahan@f5.com&gt;
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Liam reported a problem when trying to restart wasm-wasi-component based
applications using the /control/applications/APPLICATION_NAME/restart
endpoint.

The application would become unresponsive.

What was happening was the old application process(es) weren't
exit(3)ing and so while we were starting new application processes, the
old ones were still hanging around in a non-functioning state.

When we are terminating an application it must call exit(3).

So that's what we do. We use the return value of nxt_unit_run() as the
exit status.

Due to exit(3)ing we also need to now explicitly handle the return on
error case.

Reported-by: Liam Crilly &lt;liam@nginx.com&gt;
Fixes: 20ada4b5c ("Wasm-wc: Core of initial Wasm component model language module support")
Closes: https://github.com/nginx/unit/issues/1179
Tested-by: Liam Crilly &lt;liam@nginx.com&gt;
Tested-by: Danielle De Leo &lt;d.deleo@f5.com&gt;
Co-developed-by: Dan Callahan &lt;d.callahan@f5.com&gt;
Signed-off-by: Dan Callahan &lt;d.callahan@f5.com&gt;
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Wasm-wc: Bump the mio crate from 0.8.10 to 0.8.11</title>
<updated>2024-03-11T12:09:55+00:00</updated>
<author>
<name>dependabot[bot]</name>
<email>49699333+dependabot[bot]@users.noreply.github.com</email>
</author>
<published>2024-03-04T21:34:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=6b13857142782167a544c55e67e292e5e30230fa'/>
<id>6b13857142782167a544c55e67e292e5e30230fa</id>
<content type='text'>
Bumps mio &lt;https://github.com/tokio-rs/mio&gt; from 0.8.10 to 0.8.11.

Fixes receiving IOCP events after deregistering a Windows named pipe.

Not that that effects Unit...

Link: &lt;https://github.com/nginx/unit/security/dependabot/1&gt;
Link: Changelog &lt;https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md&gt;
Link: Commits &lt;https://github.com/tokio-rs/mio/compare/v0.8.10...v0.8.11&gt;
Signed-off-by: dependabot[bot] &lt;support@github.com&gt;
Reviewed-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
[ Tweaked commit message/subject - Andrew ]
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bumps mio &lt;https://github.com/tokio-rs/mio&gt; from 0.8.10 to 0.8.11.

Fixes receiving IOCP events after deregistering a Windows named pipe.

Not that that effects Unit...

Link: &lt;https://github.com/nginx/unit/security/dependabot/1&gt;
Link: Changelog &lt;https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md&gt;
Link: Commits &lt;https://github.com/tokio-rs/mio/compare/v0.8.10...v0.8.11&gt;
Signed-off-by: dependabot[bot] &lt;support@github.com&gt;
Reviewed-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
[ Tweaked commit message/subject - Andrew ]
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Wasm-wc: Add Cargo.lock</title>
<updated>2024-02-21T16:20:32+00:00</updated>
<author>
<name>Andrew Clayton</name>
<email>a.clayton@nginx.com</email>
</author>
<published>2024-02-20T14:43:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=8d030139a1bde3ee640852d1348eb595cb376d05'/>
<id>8d030139a1bde3ee640852d1348eb595cb376d05</id>
<content type='text'>
It seems we do want to track this thing. This is just the latest version
that cargo had generated for me.

Cc: Dan Callahan &lt;d.callahan@f5.com&gt;
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It seems we do want to track this thing. This is just the latest version
that cargo had generated for me.

Cc: Dan Callahan &lt;d.callahan@f5.com&gt;
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Wasm-wc: Allow to use the 'reactor' adaptor again</title>
<updated>2024-02-21T16:20:32+00:00</updated>
<author>
<name>Andrew Clayton</name>
<email>a.clayton@nginx.com</email>
</author>
<published>2024-02-13T16:21:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=60eb6c43a71fb0f6cf21759917e0247bdb88b892'/>
<id>60eb6c43a71fb0f6cf21759917e0247bdb88b892</id>
<content type='text'>
With the initial port to wasmtime 17 we could no longer use the
'reactor' adaptor but had to switch to the more restrictive 'proxy'
adaptor.

This meant amongst other things (probably) we could no longer access the
filesystem.

Thanks to Joel Dice for pointing out the fix.

With this we can go back to using the 'reactor' adaptor again and things
are back to working as before.

It's worth noting that you can use either the 'proxy' or 'reactor'
adaptor depending on your requirements.

Cc: Joel Dice &lt;joel.dice@fermyon.com&gt;
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With the initial port to wasmtime 17 we could no longer use the
'reactor' adaptor but had to switch to the more restrictive 'proxy'
adaptor.

This meant amongst other things (probably) we could no longer access the
filesystem.

Thanks to Joel Dice for pointing out the fix.

With this we can go back to using the 'reactor' adaptor again and things
are back to working as before.

It's worth noting that you can use either the 'proxy' or 'reactor'
adaptor depending on your requirements.

Cc: Joel Dice &lt;joel.dice@fermyon.com&gt;
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Wasm-wc: Upgrade to wasmtime 17</title>
<updated>2024-02-21T16:20:32+00:00</updated>
<author>
<name>Andrew Clayton</name>
<email>a.clayton@nginx.com</email>
</author>
<published>2024-01-30T14:44:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=98f808af2c23966e49abc7b2556e40adddbb51b9'/>
<id>98f808af2c23966e49abc7b2556e40adddbb51b9</id>
<content type='text'>
This brings WASI 0.2.0 support.

Link: &lt;https://github.com/bytecodealliance/wasmtime/releases/tag/v17.0.0&gt;
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This brings WASI 0.2.0 support.

Link: &lt;https://github.com/bytecodealliance/wasmtime/releases/tag/v17.0.0&gt;
Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Wasm-wc: Improve request buffer handling</title>
<updated>2024-02-21T16:20:32+00:00</updated>
<author>
<name>Andrew Clayton</name>
<email>a.clayton@nginx.com</email>
</author>
<published>2024-01-29T11:35:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/unit.git/commit/?id=ac3a54d67181bb8bfbe6753058941c91dd200c63'/>
<id>ac3a54d67181bb8bfbe6753058941c91dd200c63</id>
<content type='text'>
When Unit receives a request, if the body of that request is greater
than a certain amount (16KiB by default) then it is written to a
temporary file.

When a language module goes to read the request body in such situations
it will end up using read(2).

The wasm-wasi-component language module was failing to properly read
request bodies of around 2GiB or more.

This is because (on Linux at least) read(2) (and other related system
calls) will only read (or write) at most 0x7ffff000 (2,147,479,552)
bytes, this is the case for both 32 and 64-bit systems.

Regardless, it's probably not a good idea doing IO in such large chunks
anyway.

This patch changes the wasm-wasi-component language module to read the
request buffer in 32MiB chunks (this matches the original 'wasm'
language module).

We are still limited to a 4GiB address space and can only upload files a
little under 4GiB.

Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When Unit receives a request, if the body of that request is greater
than a certain amount (16KiB by default) then it is written to a
temporary file.

When a language module goes to read the request body in such situations
it will end up using read(2).

The wasm-wasi-component language module was failing to properly read
request bodies of around 2GiB or more.

This is because (on Linux at least) read(2) (and other related system
calls) will only read (or write) at most 0x7ffff000 (2,147,479,552)
bytes, this is the case for both 32 and 64-bit systems.

Regardless, it's probably not a good idea doing IO in such large chunks
anyway.

This patch changes the wasm-wasi-component language module to read the
request buffer in 32MiB chunks (this matches the original 'wasm'
language module).

We are still limited to a 4GiB address space and can only upload files a
little under 4GiB.

Signed-off-by: Andrew Clayton &lt;a.clayton@nginx.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
