Skip to content

Commit 33d1efc

Browse files
committed
fix(mmds): Update micro-http for empty MMDS path
When querying a MMDS path that has an empty content, the response didn't contain 'Content-Length' field, resulting in the client waiting for the connection closed by the server or timeout. To fix this issue, micro-http made a change to have the field when the response status code is not 1XX or 204. This commit updates Cargo.lock file to consume this change and also adds an integration test to ensure that it doesn't timeout for an empty MMDS path. The micro-http's change was made on firecracker-microvm/micro-http#48. Signed-off-by: Takahiro Itazuri <[email protected]>
1 parent 9824524 commit 33d1efc

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ and this project adheres to
7474
mechanism to reliably fetch Firecracker PID. With this change, Firecracker
7575
process's PID will always be available in the Jailer's root directory
7676
regardless of whether new_pid_ns was set.
77+
- [#4468](https://github.com/firecracker-microvm/firecracker/pull/4468): Fixed a
78+
bug where a client would hang or timeout when querying for an MMDS path whose
79+
content is empty, because the 'Content-Length' header field was missing in a
80+
response.
7781

7882
## \[1.6.0\]
7983

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/integration_tests/functional/test_mmds.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ def test_mmds_response(uvm_plain, version):
296296
"res_key": "res_value",
297297
},
298298
"dummy_array": ["arr_val1", "arr_val2"],
299+
"dummy_empty": "",
299300
},
300301
"Limits": {"CPU": 512, "Memory": 512},
301302
"Usage": {"CPU": 12.12},
@@ -328,12 +329,12 @@ def test_mmds_response(uvm_plain, version):
328329
expected = (
329330
"ami-id\n"
330331
"dummy_array\n"
332+
"dummy_empty\n"
331333
"dummy_obj/\n"
332334
"local-hostname\n"
333335
"public-hostname\n"
334336
"reservation-id"
335337
)
336-
337338
run_guest_cmd(ssh_connection, cmd, expected)
338339

339340
cmd = pre + "latest/meta-data/ami-id/"
@@ -342,6 +343,9 @@ def test_mmds_response(uvm_plain, version):
342343
cmd = pre + "latest/meta-data/dummy_array/0"
343344
run_guest_cmd(ssh_connection, cmd, "arr_val1")
344345

346+
cmd = pre + "latest/meta-data/dummy_empty"
347+
run_guest_cmd(ssh_connection, cmd, "")
348+
345349
cmd = pre + "latest/Usage/CPU"
346350
run_guest_cmd(
347351
ssh_connection,

0 commit comments

Comments
 (0)