-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't get hostname on WSL2+docker host network #1158
Comments
Thanks for reporting the issue! Neither do I remember the original idea behind the name resolution. We can probably change this like you suggested and see if we break some other obscure use case 馃槈 Would you like to offer a PR? |
Created #1160 to address the issue, in my tests it works now. |
Great thanks! I was going to submit a PR tonight, you beat me to it 馃檪 馃殌 |
I'm hoping to get 3.3.2 out this evening so I went ahead 馃槈 |
3.3.2 should be available on NuGet now, thanks for the report and past contributions! |
Hi, this is a rather obscure bug 馃檪
When running Quartz using the SimpleInstanceIdGenerator on WSL2 + docker + host network, it fails to get the current hostname and crashes when initializing the scheduler factory.
I've created a repro in https://github.com/mausch/QuartzNetHostAddressTest
The exception is "Cannot run without an instance id." thrown at
quartznet/src/Quartz/Impl/StdSchedulerFactory.cs
Line 930 in a22915a
BTW it seems that throw should carry the inner exception i.e. make it:
The way I propose to fix this is to simplify
quartznet/src/Quartz/Simpl/HostNameBasedIdGenerator.cs
Lines 61 to 62 in 2fccbc1
Not sure why it's doing all that DNS resolution just to get the hostname? Couldn't that be just a call to
Dns.GetHostName()
? I looked through the history of that file but couldn't figure out why, maybe someone else knows!Many thanks,
Mauricio
The text was updated successfully, but these errors were encountered: