Skip to content
Permalink
Browse files

Use major version only for registration

Each registration is being hashed (commands, events, ingesters, name and version) in order to determine if the starting SDM is going to connect to an  existing or a new session.

This means if we keep changing the version number on each deploy or startup, we'll end up with new sessions all the time which is not desirable. We only want a new session when the registration payload (events, commands or ingesters) do actually change.

This change will always only send the major version of the SDM version to keep it stable and allow us to connect to an existing session. If a new session should is desired, the major version can be rev'ed indicating an incompatible change.
  • Loading branch information...
cdupuis committed Jul 4, 2019
1 parent ef93b4c commit 46a920020ed613c7a7a6c24e995d946e4abc2754
@@ -505,7 +505,8 @@ export class ClusterMasterRequestProcessor extends AbstractRequestProcessor impl
const messageCount = this.messages.length;
const statsd = (this.configuration.statsd as any).__instance as StatsD;
if ((!this.backoffInitiated && messageCount >= threshold) ||
(this.backoffInitiated && messageCount >= (threshold * factor))) {
(this.backoffInitiated && messageCount >= (threshold * factor)) ||
this.shutdownInitiated) {
sendMessage({
control: {
name: "backoff",
@@ -96,7 +96,7 @@ function firstRow(configuration: Configuration,
const gitInfo = info(automations);
let c: string = "";

c += ` ${chalk.grey("Version")} ${automations.version}`;
c += ` ${chalk.grey("Version")} ${configuration.version}`;
if (gitInfo && gitInfo.git) {
c += ` ${chalk.grey("Sha")} ${gitInfo.git.sha.slice(0, 7)}`;
c += ` ${chalk.grey("Repository")} ${gitInfo.git.repository}`;
@@ -1,4 +1,3 @@
import * as HttpsProxyAgent from "https-proxy-agent";
import * as stringify from "json-stringify-safe";
import promiseRetry = require("promise-retry");
import * as serializeError from "serialize-error";
@@ -7,7 +6,6 @@ import * as zlib from "zlib";
import { Configuration } from "../../../configuration";
import { HttpMethod } from "../../../spi/http/httpClient";
import { logger } from "../../../util/logger";
import { Deferred } from "../../util/Deferred";
import { registerShutdownHook } from "../../util/shutdown";
import {
CommandIncoming,
@@ -27,6 +27,7 @@ function prepareMetadata(automations: Automations, metadata: any) {
const i = info(automations);
const cfg = automationClientInstance().configuration;
return {
"atomist.version": cfg.version,
"atomist.description": i.description,
"atomist.license": i.license,
"atomist.author": i.author,
@@ -1,5 +1,6 @@
import * as stringify from "json-stringify-safe";
import * as _ from "lodash";
import * as semver from "semver";
import { Configuration } from "../configuration";
import { ApolloGraphClient } from "../graph/ApolloGraphClient";
import { HandleCommand } from "../HandleCommand";
@@ -295,9 +296,11 @@ export class BuildableAutomationServer extends AbstractAutomationServer {
}

get automations(): Automations {
const version = !!this.opts.version && this.opts.policy === "durable" ?
`${semver.major(this.opts.version)}.0.0` : this.opts.version;
return {
name: this.opts.name,
version: this.opts.version,
version: version || "0.0.0",
policy: this.opts.policy,
team_ids: this.opts.workspaceIds,
groups: toStringArray((this.opts as any).groups),

0 comments on commit 46a9200

Please sign in to comment.
You can’t perform that action at this time.