Skip to content

Unexpected Client close #698

Closed as not planned
Closed as not planned
@benjaminjellis

Description

@benjaminjellis

Hi,

I think sentry experienced an outage yesterday. We discovered this when one of our production services went down. After some debugging we found that a sentry service was returning a 502 which (I think) made sentry panic. See the logs snippet below where we get the html of a 502 error page from sentry

2024-10-16T19:10:45.950Z
[sentry] enabled sentry client for DSN 
[sentry] dropping client guard -> disposing client
[sentry] client close; request transport to shut down
[sentry] Get response: `
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>502 Server Error</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Server Error</h1>
<h2>The server encountered a temporary error and could not complete your request.<p>Please try again in 30 seconds.</h2>
<h2></h2>
</body></html>
`

I've spent some time digging around the source but haven't yet pinpointed where the http call is made. What I wanted to check is that if sentry::init does panic on getting a 502 (from somwhere) if you'd be open to changing the return type to a Result to make it easier to handle that failure mode?

If this is amenable I'd be more than happy to make a contribution but given this would be a breaking change I wanted to ask before writing any code.

Let me know what you think.

Thanks,

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions