question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement a reconciler to enable guaranteed delivery semantics for operators.

See original GitHub issue

A prototype system I’m working with has a controller implemented using the java client and one using this javascript client.

Both serve a similar purpose, they watch some configmaps and apply changes to some service in response to the events they receive.

In the java case there is the concept of a reconciler and in the javascript the controller is based on the informer example.

The main interesting difference is that the java case has a clear way to handle errors. Specifically errors that occur when using the event information within the controller to update some other service. If an error occurs with the java client then the reconcile function changes its return value. The system will then call it again later to have another go at handling the same events.

In the javascript case we can’t see any support for handling this particular type of error. Is it possible? Or is that not supported? (Searching across kubernetes-client this type of support was only obvious with the java client.)

Some more detail:

If there was code like this how would an error be handled such that the system would retry this add event later

informer.on(‘add’, (obj: k8s.V1Pod) => { console.log(Added: ${obj.metadata!.name}); //Call out to some system here that might fail });

In the java we get to indicate with the reconcile return value that the event should get retried again in the future

public Result reconcile(Request request) { try { //do something that might throw an error } catch (Exception e) { LOG.error("Exception occured , e.getMessage(), e); return new Result(true); } return new Result(false); }

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
brendandburnscommented, Jul 29, 2022

Of course it’s worth pointing out that the reconciler pattern has it’s own problems which is that you have to make sure that everything that you do is idempotent. e.g. if your handler makes some changes and then errors out and is re-run, you have to make sure that your handler can handle the partially complete state from the previous version.

1reaction
brendandburnscommented, Jul 29, 2022

I think that is a reasonable summary. In general, the Java client (and also things like the operator SDK in golang) have more extensive capabilities for writing more sophisticated operators. This isn’t really about the language but rather just who has been involved in the development of the client SDKs and how much time they have been able to dedicate to that development.

I’m going to rename this issue to reflect the feature request for a reconciler.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · kubernetes-client/javascript - GitHub
Implement a reconciler to enable guaranteed delivery semantics for operators. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will...
Read more >
Operators OpenShift Container Platform 4.10 | Red Hat ...
This document provides information for working with Operators in OpenShift Container Platform. This includes instructions for cluster administrators on how ...
Read more >
Demystifying Apache Kafka Message Delivery Semantics
This delivery semantic is ideal for applications where receiving every message is more important than having high throughput and low latency.
Read more >
Error reference | Anthos Config Management - Google Cloud
The annotation configmanagement.gke.io/managed=enabled is not necessary. ... KNV1060: The "shipping" reconciler cannot manage resources declared in the Root ...
Read more >
The Big Little Guide to Message Queues - Sudhir Jonathan
Delivery guarantees that the queuing systems make (at-least-once, at-most-once, and exactly-once semantics). Ordering and FIFO guarantees and how they ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found