Commit Graph

18 Commits

Author SHA1 Message Date
Joe Chen
2589fef13e
lib/background: upgrade Routine interface with context and errors (#62136)
This PR is a result/followup of the improvements we've made in the [SAMS repo](https://github.com/sourcegraph/sourcegraph-accounts/pull/199) that allows call sites to pass down a context (primarily to indicate deadline, and of course, cancellation if desired) and collects the error returned from `background.Routine`s `Stop` method.

Note that I did not adopt returning error from `Stop` method because I realize in monorepo, the more common (and arguably the desired) pattern is to hang on the call of `Start` method until `Stop` is called, so it is meaningless to collect errors from `Start` methods as return values anyway, and doing that would also complicate the design and semantics more than necessary.

All usages of the the `background.Routine` and `background.CombinedRoutines` are updated, I DID NOT try to interpret the code logic and make anything better other than fixing compile and test errors.

The only file that contains the core change is the [`lib/background/background.go`](https://github.com/sourcegraph/sourcegraph/pull/62136/files#diff-65c3228388620e91f8c22d91c18faac3f985fc67d64b08612df18fa7c04fafcd).
2024-05-24 10:04:55 -04:00
Noah S-C
9b6ba7741e
bazel: transcribe test ownership to bazel tags (#62664) 2024-05-16 15:51:16 +01:00
James McNamara
960d97bf8b
bazel: first pass at moving moving logging linting into nogo (#58910)
* First pass at moving moving logging linting into Bazel

* fixed negation operators

* Update dev/linters/logging/logging.go

Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>

* added more exceptions and refactored one or two impls

* added nogo lint pragmas to offending files

* ran configure

* reverted git-combine refactor

* ran configure

* reverted test as well

---------

Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
2024-01-02 10:07:25 -08:00
Jean-Hadrien Chabran
bc5490c4bb
bazel: introduce build files for Go (#46770) 2023-01-23 14:00:01 +01:00
Jean-Hadrien Chabran
51cb764418
Revert "Revert "Revert "don't special-case dev mode for SRC_HTTP_ADDR default (#45139)""" (#45239)
Revert "Revert "Revert "don't special-case dev mode for SRC_HTTP_ADDR default (#45139)"" (#45233)"

This reverts commit b4bdf28b4b.
2022-12-06 11:13:03 +01:00
Quinn Slack
b4bdf28b4b
Revert "Revert "don't special-case dev mode for SRC_HTTP_ADDR default (#45139)"" (#45233)
Revert "Revert "don't special-case dev mode for SRC_HTTP_ADDR default (#45139)" (#45152)"

This reverts commit a20edcb2aa.
2022-12-05 21:21:03 -08:00
William Bezuidenhout
a20edcb2aa
Revert "don't special-case dev mode for SRC_HTTP_ADDR default (#45139)" (#45152)
This reverts commit c312aa04a3.
2022-12-05 11:01:26 +00:00
Quinn Slack
c312aa04a3
don't special-case dev mode for SRC_HTTP_ADDR default (#45139)
sg.config.yaml sets this to :3082 anyway, which means it listens on all ports.
2022-12-05 01:53:05 -08:00
Ryan Slade
38bade2aa2
gitserver: Cleanups (#38082)
A few small cleanups which are easier now that everything is in the gitserver package:

- Move Rel function into gitserver package as it is only used there
- Make LStat private
- Consistently move checker parameters as second parameter after context
- Remove unused db param from client.ReadDir
2022-07-01 13:42:03 +02:00
Eric Fritz
98fac70654
httpserver: Make pre-shutdown sleep configurable (#28159) 2021-11-24 18:16:40 -06:00
Noah S-C
29ecf38320
conf: extract deploytype shtuff into separate package (#28147) 2021-11-24 18:55:06 +00:00
Erik Seliger
c0dbd9747c
Handle SIGTERM signals (#27958)
We want to handle SIGTERM in addition to SIGINT for graceful shutdowns. They are the mechanism used by k8s to inform about an impending pod termination. We currently don't support this and our applications seem to just exit immediately when they receive a SIGTERM.
2021-11-24 19:16:00 +01:00
Camden Cheek
fbb851d72b
Appease and enforce goimports lint (#18748)
* Appease and enforce goimports lint

This commit fixes all goimports lint errors by running
`goimports -w -local github.com/sourcegraph/sourcegraph .`
and enables goimports as an enforced lint.

It also adds a goimports call to the `generate.sh` so generated
code doesn't trigger goimports lint warnings.

* Remove requirement to goimports with -local
2021-03-02 09:03:45 -07:00
Eric Fritz
e0eb8937ca
chore: Use httpserver package in frontend startup (#15707) 2020-11-18 15:30:27 -06:00
Eric Fritz
83f0541ff4
httpserver: Do not use loopback interface if host is empty (#15295) 2020-11-02 19:29:40 -06:00
Eric Fritz
e938ca8135
httpserver: Refactor server (#15183) 2020-11-02 10:31:41 -06:00
Eric Fritz
092065b79a
executor: Extract executor from precise-code-intel-executor-vm (#14883) 2020-10-26 10:13:18 -05:00
Eric Fritz
91659bb2bd
codeintel: Clean up internal HTTP server setup (#14733) 2020-10-14 17:29:51 -05:00