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

Kaigara version 1.0.0+ (kaigaraRun) does not "break" but go into endless loop when encountering EOF #84

Open
ianeinser opened this issue Dec 13, 2022 · 0 comments

Comments

@ianeinser
Copy link

ianeinser commented Dec 13, 2022

Hi @xenirio

There is a bug in the latest Kaigara (v1.0.0+) in function Publish (pkg/logstream/redis.go).

in v0.1.34, when Kaigara encounters EOF (during new installation or db setup) after finishing creating SQL tables, it breaks and reports exit(0)

but in v1.0.0+, when Kaigara encounters EOF, it does not break but get inside endless loop

[Kaigara] 2022/12/13 02:38:45 ERR: read |0: file already closed
[Kaigara] 2022/12/13 02:38:45 INF: bytes read - 0, buf: ainCurrencyTableField: migrated (0.0313s) ======

ChangeBlockch
[Kaigara] 2022/12/13 02:38:45 ERR: read |0: file already closed
[Kaigara] 2022/12/13 02:38:45 INF: bytes read - 0, buf: .
WARNING: Skipping key "VAULT_TOKEN". Already set in ENV.
n ENV
[Kaigara] 2022/12/13 02:38:45 ERR: read |0: file already closed
[Kaigara] 2022/12/13 02:38:45 INF: bytes read - 0, buf: ainCurrencyTableField: migrated (0.0313s) ======

ChangeBlockch
[Kaigara] 2022/12/13 02:38:45 ERR: read |0: file already closed
[Kaigara] 2022/12/13 02:38:45 INF: bytes read - 0, buf: .
WARNING: Skipping key "VAULT_TOKEN". Already set in ENV.
n ENV
[Kaigara] 2022/12/13 02:38:45 ERR: read |0: file already closed
[Kaigara] 2022/12/13 02:38:45 INF: bytes read - 0, buf: ainCurrencyTableField: migrated (0.0313s) ======

I suppose it is due to the reason that you defined

var ls logstream.LogStream

as global variable in main, so when the function Publish returns, ls is never released, hence kaigara can never exit(0). I am not clear what scenario you need to retain ls after error reports, but it creates a bug during new installation or when new SQL tables are added.

Thanks

@ianeinser ianeinser changed the title Kaigara version 1.0.0+ does not "break" but go into endless loop when encountering EOF Kaigara version 1.0.0+ (kaigaraRun) does not "break" but go into endless loop when encountering EOF Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant