Skip to content

Conversation

@techwmazur
Copy link

Resolve an issue in Microsoft GDK titles where WinHttpSendRequest intermittently failed with error code 12007 in Release Package builds. This fix delays the initialization of the HTTP session until the network stack is fully ready and the first HTTP request is made

https://learn.microsoft.com/pl-pl/gaming/gdk/docs/features/console/networking/initialization-connectivity-networking

Copy link
Collaborator

@jpnurmi jpnurmi left a comment

Choose a reason for hiding this comment

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

Any idea if this works for Xbox One, too?

Maybe we could use:

  1. if(XBOX) in CMake

    set(XBOX TRUE)

  2. #ifdef SENTRY_PLATFORM_XBOX in C

    # define SENTRY_PLATFORM_XBOX

?

@techwmazur
Copy link
Author

@jpnurmi How can I address "Danger" CI Issue?

Resolve an issue in Microsoft GDK titles where WinHttpSendRequest intermittently failed with error code 12007 in Release Package builds. This fix delays the initialization of the HTTP session until the network stack is fully ready and the first HTTP request is made

https://learn.microsoft.com/pl-pl/gaming/gdk/docs/features/console/networking/initialization-connectivity-networking
Copy link
Contributor

@vaind vaind left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution. I've got some concerns listed below:

@@ -0,0 +1,64 @@
#include "sentry_boot.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should keep the contents here in the *winhttp.c file instead of creating a new one. So far, the mapping is file=transport. This would break that by only extending what's needed for winhttp transport.

Copy link
Author

Choose a reason for hiding this comment

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

I've created dedicated file because xnetworking requires c++ compiler. Having that in mind, do you still think that it should be merged to winhttp.c?

Copy link
Author

Choose a reason for hiding this comment

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

@vaind ping

Copy link
Contributor

Choose a reason for hiding this comment

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

Then it's probably good as is, I'll leave this up to the maintainers

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, it may be worthwile to just move this PR to sentry-xbox repository. Then this being a cpp file would be a non-issue

Comment on lines +42 to +43
DWORD result = WaitForSingleObjectEx(
network_initialized_event, INFINITE, FALSE);
Copy link
Contributor

Choose a reason for hiding this comment

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

This may block indefinitely. Is that the right thing to do? I guess it's alright if we're on the background thread, but might be something to keep in mind in relation to #1316 - at the very least, add a TODO mentioning that issue

Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to what we do for Switch in

#ifdef SENTRY_PLATFORM_NX
if (!sentry_nx_curl_connect(state->nx_state)) {
return; // TODO should we dump the envelope to disk?
}
#endif

Comment on lines +209 to +210
sentry__transport_ensure_network_initialized();
sentry__winhttp_session_start(state);
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to make sure - are both of these safe to call from a background thread?

winhttp_bgworker_state_t *state = (winhttp_bgworker_state_t *)_state;

#ifdef SENTRY_PLATFORM_XBOX
if (!state->session) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We're only checking session once, however, the suspend/resume cycle would influence the connectivity. Do we need to ensure connection every time we make a request instead?

@supervacuus
Copy link
Collaborator

@vaind: with the changes introduced in #1359 can this be closed?

@vaind
Copy link
Contributor

vaind commented Sep 16, 2025

@vaind vaind closed this Sep 16, 2025
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.

5 participants