Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Log occurred exception even if it doesn't have cause #218

Merged
merged 2 commits into from
Sep 15, 2023

Conversation

JuliaIskra
Copy link
Contributor

I have a problem in my application where it cannot reconnect to Nakadi and I can't figure out why, because exception is not logged, apparently, because the occurring exception doesn't have a cause:

Reconnecting failed, retry again in 10 seconds, SubscriptionId: <uuid>'

@mdedetrich
Copy link
Collaborator

mdedetrich commented Sep 14, 2023

I don't think this will have the intended effect because it will just delegate to def info(message: String, args: Any*) and since args is just Any it will only print a reference/toString of e and not the staktrace (which is what I believe you want).

You need to either call def info(marker: Marker, message: String, cause: Throwable) or def warn(message: String, cause: Throwable)

Signed-off-by: Julia Nemtseva <[email protected]>
@JuliaIskra JuliaIskra changed the title Commit occurred exception even if it doesn't have cause Log occurred exception even if it doesn't have cause Sep 14, 2023
@JuliaIskra
Copy link
Contributor Author

I have the following issue:

my application connects to nakadi and reads events successfully several times:
image

but after a while the stream is disconnected by the server due to timeout (as above), but it cannot reconnect again:
image

And this lasts until I restart the application. As you can see there is no indication to what's the reason of the reconnection failure. That's why I want to add this logging.

Nakadi supporters told me that server responds with 401 for my app attempts to reconnect. I was using 0.9.2 kanadi lib. @mdedetrich @itachi3 @pascalh @gchudnov do you have any ideas why this might happen?

I plan to update to the latest version and hope to get this PR merged and released in version 0.11.1 to see what's really the root cause.

Could you please tell me when you can release a new version with this PR's changes?

@mdedetrich
Copy link
Collaborator

So I can approve the PR but I can't really release it (I don't actually work at Zalando anymore and the release is done manually on someones machine)

@gchudnov
Copy link
Collaborator

@JuliaIskra
Hi, wondering if you have something else around in logs?

@gchudnov
Copy link
Collaborator

let me check, will merge and release it soon

@gchudnov
Copy link
Collaborator

@mdedetrich
will merge if no objections

@mdedetrich
Copy link
Collaborator

@mdedetrich will merge if no objections

No objections from me, ill approve it just to make it official

Copy link
Collaborator

@mdedetrich mdedetrich left a comment

Choose a reason for hiding this comment

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

lgtm

@gchudnov gchudnov merged commit d77479b into zalando-nakadi:master Sep 15, 2023
4 checks passed
@gchudnov
Copy link
Collaborator

Thank you,
merged

@gchudnov
Copy link
Collaborator

I'll release it in 0.11.1 version, given that @JuliaIskra is using akka, and later in pekko as well (0.20.1).

gchudnov pushed a commit that referenced this pull request Sep 15, 2023
* Use warn logging level and expose the exception itself, not the cause

Signed-off-by: Julia Nemtseva <[email protected]>
(cherry picked from commit d77479b)
@gchudnov
Copy link
Collaborator

gchudnov commented Sep 15, 2023

released 0.11.1 to sonatype for scala 2.12 and 2.13

https://github.com/zalando-nakadi/kanadi/releases

@JuliaIskra JuliaIskra deleted the jn-log-error-properly branch September 15, 2023 14:44
@JuliaIskra
Copy link
Contributor Author

thank you so much!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants