Skip to content

connect trace does not log server uri when reconnecting #547

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

Closed
hoodaajay1 opened this issue Sep 20, 2021 · 4 comments
Closed

connect trace does not log server uri when reconnecting #547

hoodaajay1 opened this issue Sep 20, 2021 · 4 comments

Comments

@hoodaajay1
Copy link

When we connect to nats initially the trace shows the server UI

[07:01:00.298] connect trace: creating connection object
[07:01:00.324] connect trace: creating executors
[07:01:00.325] connect trace: creating reader and writer
[07:01:00.33] connect trace: connection object created
[07:01:00.33] connect trace: starting connect loop
[07:01:00.331] connect trace: setting status to connecting
[07:01:00.331] connect trace: trying to connect to nats://localhost:4222
[07:01:00.331] connect trace: starting connection attempt, 30.000 (s) remaining
[07:01:00.332] connect trace: waiting for reader, 29.999 (s) remaining

However when it tries to reconnect the URI is not logged which is not helpful as if we have different nats servers to connect to & one of them has a problem its tough to find out.

Changing line 357 in NatsCOnnection.java to will fix it.
timeCheck(trace, end, "starting connection attempt to " + serverURI);

[07:02:26.735] connect trace: starting connection attempt, 30.000 (s) remaining
[07:02:26.736] connect trace: waiting for reader, 29.999 (s) remaining
[07:02:26.736] connect trace: waiting for writer, 29.999 (s) remaining
[07:02:26.736] connect trace: cleaning pong queue, 29.999 (s) remaining
[07:02:26.737] connect trace: connecting data port, 29.998 (s) remaining
[07:02:26.738] connect trace: reading info, version and upgrading to secure if necessary, 29.997 (s) remaining
[07:02:26.739] connect trace: starting reader, 29.996 (s) remaining
[07:02:26.74] connect trace: starting writer, 29.995 (s) remaining
[07:02:26.741] connect trace: sending connect message, 29.995 (s) remaining
[07:02:26.741] connect trace: sending initial ping, 29.994 (s) remaining
[07:02:26.742] connect trace: updating status to connected, 29.993 (s) remaining
[07:02:26.742] connect trace: status updated

@scottf
Copy link
Contributor

scottf commented Sep 20, 2021

That would probably be useful. I'll look into it when I get a chance, you are always welcome to make a fork and submit a PR.

@hoodaajay1
Copy link
Author

hoodaajay1 commented Sep 21, 2021 via email

@scottf
Copy link
Contributor

scottf commented Sep 21, 2021

@hoodaajay1 You probably need to fork and also you will need to sign your commits. https://docs.github.com/en/github/authenticating-to-github/managing-commit-signature-verification/signing-commits

@scottf
Copy link
Contributor

scottf commented Mar 30, 2024

#1106

@scottf scottf closed this as completed Mar 30, 2024
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

No branches or pull requests

3 participants