Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #1694: Populated the SOURCE_HOST vanflow attribute in the http2… #1695

Merged
merged 3 commits into from
Dec 12, 2024

Conversation

ganeshmurthy
Copy link
Contributor

… adaptor

qd_http2_stream_info_t *stream_info = 0;
qd_error_t error = get_stream_info_from_hashtable(transport_handle, &stream_info, stream_id);
assert(stream_info != 0);
if(error == QD_ERROR_NOT_FOUND) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Question that has nothing to do with this patch: should failure to find the given stream cause the observer to disable itself? Looks like we assert if this happens in a debug build so why continue decoding in a production build?

Copy link
Member

Choose a reason for hiding this comment

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

Why is there an assert statement here? Does null stream_info indicate a software failure or could it be some kind of protocol anomaly. If it's the latter, crashing (even in a debug build) is unacceptable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should failure to find the given stream cause the observer to disable itself?

I am thinking aloud here. Say there are 100 streams in a http2 request and the first stream id is not found, would it be ok to continue to report on the other 99 streams instead of calling qdpo_http2_final() ?

Suggested change
if(error == QD_ERROR_NOT_FOUND) {
if (!stream_info)
return;
if(error == QD_ERROR_NOT_FOUND) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

kind of protocol anomaly

I would like to keep the assert in the debug build just to so we can get a chance to see why the issue is happening. But in production, we should just return if the stream_info is not found.

Copy link
Member

Choose a reason for hiding this comment

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

Also, 'if' is not a function call. Please put a space after it.

Copy link
Member

Choose a reason for hiding this comment

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

kind of protocol anomaly

I would like to keep the assert in the debug build just to so we can get a chance to see why the issue is happening. But in production, we should just return if the stream_info is not found.

If you're using the assert to look for a bug that you're seeing, convert this to a draft PR and remove the assert after you solve the problem.

I would expect that fuzz testing might cause that assert to fire. I don't think we want the router crashing in test due to known protocol anomalies.

@ganeshmurthy ganeshmurthy merged commit f6f40bd into skupperproject:main Dec 12, 2024
41 checks passed
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.

3 participants