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

Remove dead code from cannon. #3389

Merged
merged 2 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion changelog.d/0-release-notes/pr-3260
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ with the temporary contents of
`brig.config.optSettings.setFederationDomainConfigs`, it is safe to
remove the latter and the above lines from the federator config.

[See also.](http://docs.wire.com/understand/configure-federation.html#if-your-instance-has-been-federating-before) (#3260, #3384)
[See also.](http://docs.wire.com/understand/configure-federation.html#if-your-instance-has-been-federating-before) (#3260, #3384, #3389)
4 changes: 0 additions & 4 deletions charts/cannon/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ data:
host: gundeck
port: 8080

brig:
host: brig
port: 8080

drainOpts:
gracePeriodSeconds: {{ .Values.config.drainOpts.gracePeriodSeconds }}
millisecondsBetweenBatches: {{ .Values.config.drainOpts.millisecondsBetweenBatches }}
Expand Down
4 changes: 0 additions & 4 deletions services/cannon/cannon.integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ gundeck:
host: 127.0.0.1
port: 8086

brig:
host: 0.0.0.0
port: 8082

drainOpts:
gracePeriodSeconds: 1
millisecondsBetweenBatches: 500
Expand Down
4 changes: 0 additions & 4 deletions services/cannon/cannon2.integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ gundeck:
host: 127.0.0.1
port: 8086

brig:
host: 0.0.0.0
port: 8082

drainOpts:
gracePeriodSeconds: 1
millisecondsBetweenBatches: 5
Expand Down
12 changes: 0 additions & 12 deletions services/cannon/src/Cannon/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ module Cannon.Options
port,
cannon,
gundeck,
brig,
Brig (..),
externalHost,
externalHostFile,
logLevel,
Expand Down Expand Up @@ -69,15 +67,6 @@ makeFields ''Gundeck

deriveApiFieldJSON ''Gundeck

data Brig = Brig
{ _brigHost :: !Text,
_brigPort :: !Word16
}
deriving (Eq, Show, Generic)

makeFields ''Brig
deriveApiFieldJSON ''Brig

data DrainOpts = DrainOpts
{ -- | Maximum amount of time draining should take. Must not be set to 0.
_drainOptsGracePeriodSeconds :: Word64,
Expand All @@ -98,7 +87,6 @@ deriveApiFieldJSON ''DrainOpts
data Opts = Opts
{ _optsCannon :: !Cannon,
_optsGundeck :: !Gundeck,
_optsBrig :: !Brig,
_optsLogLevel :: !Level,
_optsLogNetStrings :: !(Maybe (Last Bool)),
_optsLogFormat :: !(Maybe (Last LogFormat)),
Expand Down
8 changes: 0 additions & 8 deletions services/cannon/src/Cannon/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ import qualified System.Logger.Extended as L
import System.Posix.Signals
import qualified System.Posix.Signals as Signals
import System.Random.MWC (createSystemRandom)
import Util.Options (Endpoint (..))
import Wire.API.FederationUpdate
import qualified Wire.API.Routes.Internal.Cannon as Internal
import Wire.API.Routes.Public.Cannon
import Wire.API.Routes.Version.Wai
Expand All @@ -82,11 +80,6 @@ run o = do
refreshMetricsThread <- Async.async $ runCannon' e refreshMetrics
s <- newSettings $ Server (o ^. cannon . host) (o ^. cannon . port) (applog e) m (Just idleTimeout)

-- Get the federation domain list from Brig and start the updater loop
let brigEndpoint = Endpoint bh bp
Brig bh bp = o ^. brig
(_, updateDomainsThread) <- syncFedDomainConfigs brigEndpoint g emptySyncFedDomainConfigsCallback

let middleware :: Wai.Middleware
middleware =
versionMiddleware (fold (o ^. disabledAPIVersions))
Expand All @@ -109,7 +102,6 @@ run o = do
-- the same time and then calling the drain script. I suspect this might be due to some
-- cleanup in wai. this needs to be tested very carefully when touched.
Async.cancel refreshMetricsThread
Async.cancel updateDomainsThread
L.close (applog e)
where
idleTimeout = fromIntegral $ maxPingInterval + 3
Expand Down