Skip to content

fix: fix some edge cases for HTTP integration#465

Merged
crepererum merged 1 commit intomainfrom
crepererum/http-edge-cases
Apr 16, 2026
Merged

fix: fix some edge cases for HTTP integration#465
crepererum merged 1 commit intomainfrom
crepererum/http-edge-cases

Conversation

@crepererum
Copy link
Copy Markdown
Collaborator

@crepererum crepererum commented Apr 16, 2026

Working towards #448.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some improvements to the error mapping here. This is on the guest side, mapping from WASI to Python.

I was debugging #464 and only got error messages a la Err { value: () }" because some of the respective WASI methods return Result<..., ()>. While you can get the Python backtrace to find out which method was called, it still seemed rather bad as a debugging experience. So I've improved these error messages.

Comment thread host/src/http/mod.rs
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actual bug fix: try to peak into the reqwests::Error to map the error to a proper WASI error code.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change here looks bigger than it is due to a changed indentation. It really just introduces:

  • IPv6 support
  • two low-level failure modes that we can emulate

Both is now possible due to #453, showing that this "use home-grown test harness" approach pays off.

}),
..Default::default()
},
// https://github.com/influxdata/datafusion-udf-wasm/issues/464
Copy link
Copy Markdown
Collaborator Author

@crepererum crepererum Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, using IPv6 addresses directly in URLs seems to be broken at the moment. My guess is that this is a bug in urllib3 (i.e. the Python guest code). Need to debug this later.

Comment thread host/src/http/mod.rs
ErrorKind::TimedOut => {
return HttpErrorCode::ConnectionTimeout;
}
_ => {}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that you CANNOT match all kinds because that enum is non-exhaustive.

"#;
const NUMBER_OF_IMPLEMENTATIONS: usize = 2;

let servers = BTreeMap::from([
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The integration test now uses multiple test servers because of all the different behaviors we need to emulate. There will be even more in the future when I get to #434. I think the flexibility of this is actually kinda nice.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really nice, I like this 💯

@crepererum crepererum requested a review from a team April 16, 2026 07:58
"#;
const NUMBER_OF_IMPLEMENTATIONS: usize = 2;

let servers = BTreeMap::from([
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really nice, I like this 💯

@crepererum crepererum added this pull request to the merge queue Apr 16, 2026
Merged via the queue into main with commit 1243f51 Apr 16, 2026
2 checks passed
@crepererum crepererum deleted the crepererum/http-edge-cases branch April 16, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants