Commit Graph

18 Commits

Author SHA1 Message Date
Alessandro (Ale) Segala 8680e2785a
Local file-based name resolver with SQLite (#3178)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: Josh van Leeuwen <me@joshvanl.dev>
Co-authored-by: Bernd Verst <github@bernd.dev>
2023-11-01 15:49:22 -07:00
ItalyPaleAle b4aecdfef7 Resolve long-standing TODO in mDNS component
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-02-24 20:26:28 +00:00
ItalyPaleAle 7af9c90735 mdns: shut down on context cancelation and not on signal
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-01-26 12:15:37 -08:00
ItalyPaleAle 286856ed70 Fixes
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-10-25 18:06:49 +00:00
ItalyPaleAle b9265ea3a9 Fixes to mDNS resolver
1. If the host doesn't support IPv6 (or supports only IPv6), allow the client to resolve IPs
2. Do not re-create a resolver in the hot path every time, but only if there's an error
3. Better concurrency handling with picking an address from the list via round-robin
4. Use one less background goroutine

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-10-24 23:58:14 +00:00
Alessandro (Ale) Segala bcea284c7b
Components' init functions should return interfaces (#1997)
* Components' init functions should return interfaces

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* 💄

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* pin latest berndverst contrib fork

Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>

* Fixed component registration in tests

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Updated all cert tests

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-08-25 18:27:45 -07:00
Phil Kedy 195901f1b3
Add size to channel to fix blocking when .Close is called. (#1632)
Signed-off-by: Phil Kedy <phil.kedy@gmail.com>
2022-04-01 08:20:43 -07:00
Joni Collinge addb2f57bf
update mdns name resolver to resolve feedback (#1607)
Signed-off-by: Joni Collinge <jonathancollinge@live.com>
2022-03-21 15:04:07 -07:00
Joni Collinge fe96d92bdc
Sync mDNS first browse (#1591)
* add waiter pool for first browse

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* remove waiter

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* fix up refresh channel and test

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* add more tests

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* update comments

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* push to done chan on early error

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* add closer and stop goroutine leaks in tests

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* go mod tidy

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* increase make test timeout

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* provide fallback if subscriber never receives from chans

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* use counter for sub id and drain results on context done

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* reduce concurrent test iterations to 1000

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* add comment to explain expected behaviour

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* do not remove subscribers, clear them at the end

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* update outdated comment

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* reduce concurrent test iterations to 1000

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* run cleanup in background

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* reduce concurrent test iterations to 100

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* update comment to explain cache recheck better

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

Co-authored-by: Looong Dai <long.dai@intel.com>
2022-03-21 09:18:56 -07:00
Dmitry Shmulevich c7adb917f3
update license to Apache v2.0 (#1406) 2022-01-04 19:53:31 -08:00
Joni Collinge e457b307b6
Improve mDNS nameresolver code quality (#1179)
* remove benchmark

* explicitly use zero value

* initialize slice to 0 len

* fix loop closure

* use basic int for counter

* reduce diff

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
2021-10-06 12:16:40 -07:00
Long Dai 988fed05ab
ci: standard linter config (#1102)
* ci: standard linter config

Signed-off-by: Long <long.dai@intel.com>

* Update utils.go

* fix pulsar issue

Signed-off-by: Long <long.dai@intel.com>

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-09-21 15:21:59 -07:00
meijin 8ea1f1bb44
fix calc ipv6num use ipv4 slice (#838)
Co-authored-by: Charlie Stanley <charlie.stanley@microsoft.com>
2021-05-04 18:25:19 -07:00
Phil Kedy 688df9bda4
Removed dependency on dapr/dapr in favor of dapr/kit. Fixed go mod dependencies afterwards. Go 1.16 in go.mod. Removed accidental log dependency. (#807) 2021-04-19 12:06:10 -07:00
Yaron Schneider 3ef025c604
change headers (#679) 2021-02-09 18:57:55 -08:00
Joni Collinge e881e4ba28
mDNS round robin (#540)
* WIP mdns rr

* add callback mechanism

* add initial testing

* fix lint

* add debug logs

* register as unique instance

* update comments

* add continue when no address

* fix lint

* add test for empty address list next

* refresh on new app id in the background

* fix lint

* update comment

* add way to control mDNS instance ID

* update test case

* add guard for empty refreshes

* update log message to include app id

* update log message to include app id

* update comment

Co-authored-by: Yaron Schneider <yaronsc@microsoft.com>
2020-12-14 12:50:21 -08:00
halspang f647d9eedb
Upgrade golang lint to 1.31 (#490)
Upgrade golang lint to 1.31.0

https://github.com/dapr/components-contrib/issues/439
2020-10-12 12:54:15 -07:00
Young Bu Park a6a0e3e3bc
rename servicediscovery to nameresolution pkg and refactor it (#368)
* rename servicediscovery to nameresolution pkg

* fix linter

* add comment

* add more logs
2020-06-24 11:23:15 -07:00