Comments (3)
Thanks for pointing out.
Yeah, that's the heritage from when Decaton didn't support consuming arbitrary task format. (Initially, Decaton only supported DecatonTaskRequest
protobuf format)
When we introduced TaskExtractor
for supporting arbitrary message format, there was a discussion about how to support retry-feature.
- Decaton's retry-feature is implemented as like below:
- Only change metadata-part of DecatonTaskRequest and leave raw
serializedTask
as-is, and produce it to retry-topic
- Only change metadata-part of DecatonTaskRequest and leave raw
- Problem here is:
- We have to treat
serializedTask
differently depending on messages areDecatonTaskRequest
-format or in arbitrary format. - In
DecatonTaskRequest
,serialziedTask
is aserialized_task
field in protobuf - On the other hand, when we consume arbitrary format,
serializedTask
has to be raw entire message bytes. - So, if we want to treat
DecatonTaskRequest
and arbitrary format in unified exactly same way, we have to migrate retried-task's messages to store entire message bytes in its serialized task field- However, it introduces backward incompatibility so we can't upgrade Decaton safely without stopping all consumers once. (i.e. to prevent producing retry tasks)
- We have to treat
- That's the reason Decaton has a special treatment for
DefaultTaskExtractor
(i.e.ProcessorsBuilder#consuming(String, Deserializer)
overload)
In short, you have to use DefaultTaskExtractor
only when you consume DecatonTaskRequest
format.
In short, you have to use ProcessorsBuilder#consuming(String, Deserializer)
to consume DecatonTaskRequest
format.
I guess we can solve this problem fundamentally in this attempt (#80), but unfortunately it's now stuck due to our lack of resource.
from decaton.
In short, you have to use DefaultTaskExtractor only when you consume DecatonTaskRequest format.
We are using DecatonTaskRequest
format task with DefaultTaskExtractor
(with wrapped task extractor) and retrying.
I think the problem of the code is here
https://github.com/line/decaton/blob/v3.0.2/processor/src/main/java/com/linecorp/decaton/processor/runtime/ProcessorsBuilder.java#L76
If we specify Deserializer
for .consuming()
, new DefaultTaskExtractor<>(deserializer)
for both taskExtractor
and retryTaskExtractor
.
https://github.com/line/decaton/blob/v3.0.2/processor/src/main/java/com/linecorp/decaton/processor/runtime/ProcessorsBuilder.java#L63
But if we specify TaskExtractor
for .consuming()
, retryTaskExtractor
will be wrapped with DefaultTaskExtractor
for consuming non DecatonTaskRequest
format topics even if taskExtractor
is DefaultTaskExtractor
.
https://github.com/line/decaton/blob/v3.0.2/processor/src/main/java/com/linecorp/decaton/processor/runtime/ProcessorsBuilder.java#L76
If we call .consuming()
with DefaultTaskExtractor
, deserialize DecatonTaskRequest
2 times and it failed.
I know TaskExtractor
is especially for non DecatonTaskRequest
, but it will cause a bug.
If it doesn't support DefaultTaskExtractor
, I think it should be thrown error or put logging on .cosuming()
.
from decaton.
In short, you have to use DefaultTaskExtractor only when you consume DecatonTaskRequest format
This my comment was bit wrong. Precisely, you have to use ProcessorsBuilder#consuming(String, Deserializer) to consume DecatonTaskRequest format.
If we call .consuming() with DefaultTaskExtractor, deserialize DecatonTaskRequest 2 times and it failed.
Yeah, right.
I understand that this behavior could cause a bug, but since DefaultTaskExtractor
is located in internal
package, we don't expect it to be used by users.
Though throwing an exception or logging is an option, if users "wrap" DefaultTaskExtractor (like you did) in outer extractor, it may not work.
I think adding some DefaultTaskExtractor
's javadoc about the caution for the usage is sufficient for now.
from decaton.
Related Issues (20)
- Isolate bursting key to prevent innocent keys are affected
- Narrow the scope of waiting pending task count upon dynamic property reload HOT 1
- Provide CentralDogmaPropertySupplier that can read YAML HOT 1
- NPE in DecatonTaskRetryQueueingProcessor if RetryConfig.backoff is null HOT 4
- Silence WARNs during rebalancing HOT 4
- Flaky test: CentralDogmaPropertySupplierIntegrationTest HOT 1
- Add a document about metrics
- Support unfixed backoff strategy HOT 2
- Add default values of new properties to JSON files on CentralDogma when they are supported
- Bum junit to version 5.x HOT 1
- Enqueue different taskData on retry (partial retry support)
- Subscription could be killed by RebalanceInProgressException HOT 2
- Expose e2e delivery latency metrics
- Virtual threads support HOT 1
- Potential completion leak when TaskExtractor#extract throws non-RuntimeException
- Add JDK21 to CI build target HOT 3
- Expose TopicPartition and offset from ProcessingContext HOT 2
- More heap usage safety back pressure (user controllable? back pressure based on unprocessed messages?) HOT 1
- CentralDogmaPropertySupplier may leak watchers
- Flaky test: PerKeyQuotaTest > testShaping_processingGuarantee
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 decaton.