Comments (12)
I think I would shorten the default flush interval, but a signal handler sounds good too.
A flush w/ signal handling sounds good too. ctrl+C is a little tricky because you often want to preserve the interrupt behavior at least on a second ctrl+c. Maybe a shutdown with flush on a Ctrl+D fits a graceful shutdown and flush a little better - and we leave ctrl+c alone?
We would preserve interruption with Ctrl+C of course. We can just give some time (1-2 seconds for example) to flush and after that period exit. And, the second Ctrl+C also can force exit immediately. So, single Ctrl+C - 1 second graceful period and exit, double Ctrl+C - exit immediately. Something, like this.
from fluvio.
Ok, I’m thinking the SPU should detect a disconnect from the consumer and flush. It’s probably the solution you are suggesting above.
Without handling this case, the feature feels broken.
The flush here is from the client to the SPU. Any detections on SPU side are irrelevant here.
from fluvio.
How the auto
strategy works:
- Commit happens when the next record is yelded.
- Flush happens after a certain interval (10 seconds now by default).
- Flush happens after a commit is triggered (see
item 1
in this list). - Both commit and flush are called when the stream is finished.
So, when you use -d
option, both commit and flush called in the end and it stores the last read offset regardless of all other logic.
Without -d
it quickly read all records, the flush interval has not passed yet. Another record (after 10 seconds) would store the offset. On top of that, most probably, Ctrl+C
was pressed to stop consuming. We don't have a signal handler, so it shuts down the process without giving a chance for the consumer to invoke item 4
logic in the list.
As a suggestion, we could add a handler for Ctrl+C
signal to consume
that will gently stop consuming allowing to flush offsets if needed. Wdyt @digikata
from fluvio.
Is the flush interval configurable?
from fluvio.
Is the flush interval configurable?
On CLI - no, only on API level.
from fluvio.
Ok, I’m thinking the SPU should detect a disconnect from the consumer and flush. It’s probably the solution you are suggesting above.
Without handling this case, the feature feels broken.
from fluvio.
I assume the implementation is acceptable for clients that have many knobs to manage flushing.
It's the CLI that feels odd. If I type a few records and wait for the flush to happen, it does not unless I send another record after 10 seconds.
I suggest changing CLI flushing to 1 or 2 second intervals. That would mask this behavior.'
Most users looking to test consumer offset at the CLI, won't send too many records, and we should optimize for that.
from fluvio.
I think I would shorten the default flush interval, but a signal handler sounds good too.
A flush w/ signal handling sounds good too. ctrl+C is a little tricky because you often want to preserve the interrupt behavior at least on a second ctrl+c. Maybe a shutdown with flush on a Ctrl+D fits a graceful shutdown and flush a little better - and we leave ctrl+c alone?
from fluvio.
disconnect or end of consumer session should trigger flusg
from fluvio.
disconnect or end of consumer session should trigger flusg
It does. The SIGINT
signal does not leave much space for any code execution.
from fluvio.
Can we also change the flush interval to 2 sec
?
from fluvio.
Can we also change the flush interval to
2 sec
?
from fluvio.
Related Issues (20)
- mirroring: remote mirrored topic should be read-only for local changes HOT 3
- mirroring: audit log and diagnosis
- [Enahancement]: Add BASE OFFSET to `show partition list` HOT 2
- Detect `Artifacts` Updates in `PackageSet` on `fvm update`
- [feature] add `smdk clean`
- [Bug]: `fluvio cluster resume` stuck in `trying to connect to SC` HOT 12
- [Bug]: Smartmodule consume returns an error HOT 1
- [Release Checklist]: `v0.11.8`
- `fvm self update` should perform update process
- Postpone `group` ownership in SMDK/CDK generation to Publish Time
- revise smartmodule build ci for consistency
- Bug: Connector ignore invalid transformation configuration HOT 1
- Bug: Generated `sink` connector cannot be builded due to missing `Stream::next` impl
- [Release Checklist]: `v0.11.9`
- Create a PR for release
- Capability to update `stable` channel on `fvm update`
- smartengine: missing parameters from smartmodules need to report smartmodule name
- Include README as part of `smdk publish`
- index repair API and tooling
- `cdk generate` params and generated project integrity
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluvio.