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

Do not allow writing events after fluent.Close() #105

Merged
merged 1 commit into from
Nov 20, 2021
Merged

Do not allow writing events after fluent.Close() #105

merged 1 commit into from
Nov 20, 2021

Conversation

fujimotos
Copy link
Member

This implements proposal #104 by Albin Kerouanton.

The behavior of Fluent.PostWithTime() is a bit odd in sync mode;
It will silently reopen connections, even if the client has been
finalized via Fluent.Close().

Change the behavior so that PostWithTime() returns an error
instead of doing an implicit reconnection in such a case.

Signed-off-by: Fujimoto Seiji [email protected]

This implements a proposal by Albin Kerouanton.

The behavior of `Fluent.PostWithTime()` is a bit odd in sync mode;
It will silently reopen connections, even if the client has been
finalized via `Fluent.Close()`.

Change the behavior so that `PostWithTime()` returns an error
instead of doing an implicit reconnection in such a case.

Signed-off-by: Fujimoto Seiji <[email protected]>
@fujimotos
Copy link
Member Author

fujimotos commented Nov 7, 2021

So I spent some time this weekend trying to implement #104:

  • Fluent now rejects any event submission after Close().
  • chanClosed is renamed to closed for brevity.

I also added a unit test based on the sample code in the original proposal.
(I slightly modified the code so that we can make use of assert.Equal)

@akerouanton Can you check out this PR and see if it is implemented as expected?

@fujimotos
Copy link
Member Author

TODO: Merge this patch along with #107.

@akerouanton
Copy link
Contributor

@fujimotos @tagomoris Let me know when this PR and #107 are merged and a new tag is released. I opened a PR to revendor v1.7.0 into docker. It's still opened, as there're some ongoing discussions that needs to be resolved first, but in any case, I'm willing to do the needed work to revendor when needed. If you're ok with that, just ping me when needed 😉

@fujimotos fujimotos merged commit d7068a9 into fluent:master Nov 20, 2021
@fujimotos fujimotos deleted the sf/sync-close branch November 20, 2021 03:20
@fujimotos
Copy link
Member Author

@akerouanton FYI, v1.8.0 was out yesterday.

@akerouanton
Copy link
Contributor

I'll update my PR on docker today 😉

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.

2 participants