These are chat archives for exceptionless/Discuss

10th
Feb 2016
Jamie Clarke
@jamie94bc
Feb 10 2016 09:07 UTC
@ejsmith yeah I was wondering that too. Still probably quite a few people who won't move to .NET core that quickly and from what I've seen a Settings/Config class could still be useful - could be a separate project / nuget package.
Jamie Clarke
@jamie94bc
Feb 10 2016 14:29 UTC
@niemyjski @ejsmith - Would it make sense to add a RenewLease() or similar option to the Azure queues in Foundatio?
also surely if you pass > 5 minutes into ServiceBusQueue it should throw an exception?
Blake Niemyjski
@niemyjski
Feb 10 2016 14:30 UTC
why? items could be queued for days
Eric J. Smith
@ejsmith
Feb 10 2016 14:30 UTC
yeah, so you are looking to say the intitial work item lease is maybe 1 minute long and then you can pulse it saying that you are still working on it?
Jamie Clarke
@jamie94bc
Feb 10 2016 14:32 UTC
my scenario is backend import jobs which are long running - using ServiceBusQueue implementation doesn't allow longer than 5 minute lease times
@ejsmith exactly yeah
Eric J. Smith
@ejsmith
Feb 10 2016 14:32 UTC
yeah, I think that definitely makes sense.
Blake Niemyjski
@niemyjski
Feb 10 2016 14:34 UTC
is that something that makes sense for all the other ones
Eric J. Smith
@ejsmith
Feb 10 2016 14:34 UTC
yes
Blake Niemyjski
@niemyjski
Feb 10 2016 14:34 UTC
where are we sitting on that pull request?
Eric J. Smith
@ejsmith
Feb 10 2016 14:35 UTC
good question, I wish I had more time… feel like it’s close.
not seeing any changes that you made @niemyjski
Blake Niemyjski
@niemyjski
Feb 10 2016 14:35 UTC
look on github
they are there
Eric J. Smith
@ejsmith
Feb 10 2016 14:35 UTC
in what branch?
Jamie Clarke
@jamie94bc
Feb 10 2016 14:36 UTC
I can see 4 commits from the 5th?
Blake Niemyjski
@niemyjski
Feb 10 2016 14:36 UTC
azure storage queues
pushing a small connection string one now
Eric J. Smith
@ejsmith
Feb 10 2016 14:36 UTC
hmm… github client isn’t pulling them down.
Blake Niemyjski
@niemyjski
Feb 10 2016 14:36 UTC
it quite likely is
I had the same dang issue last week with sander
he pushed something and I couldn’t see it on his fork / branch
but the code was updated
Eric J. Smith
@ejsmith
Feb 10 2016 14:37 UTC
so I did a sync and somehow I got a merge commit.
and looks like you did too @niemyjski
did this github client go off the deep end?
Blake Niemyjski
@niemyjski
Feb 10 2016 14:38 UTC
yeah
I’ll merge it in
Eric J. Smith
@ejsmith
Feb 10 2016 14:39 UTC
merge what in?
Blake Niemyjski
@niemyjski
Feb 10 2016 14:39 UTC
the pull request
Eric J. Smith
@ejsmith
Feb 10 2016 14:39 UTC
it’s not done, is it?
Blake Niemyjski
@niemyjski
Feb 10 2016 14:40 UTC
I got all the queue tests passing I had one failure on my end for in memory but wasn’t sure if it was my machine or if it was failing before. was hoping one of you could double check this
Eric J. Smith
@ejsmith
Feb 10 2016 14:40 UTC
ok, well lets wait until we are sure.
Blake Niemyjski
@niemyjski
Feb 10 2016 14:42 UTC
check em
:)
Eric J. Smith
@ejsmith
Feb 10 2016 14:51 UTC
I think I am going to build a queue behaviour that you just tell it how to identify the queue item and then it will prevent duplicates of that item from being queued while another one is still in the queue or while another one is currently processing.
@jamie94bc do you think renew is the right word?
we have dequeue, complete and abandon now.
Jamie Clarke
@jamie94bc
Feb 10 2016 14:54 UTC
good question - ServiceBus calls is RenewLock()
*it
Eric J. Smith
@ejsmith
Feb 10 2016 14:55 UTC
so you dequeue and start working… now you want to just tell the queue that i’m still working on it.
Yeah, renew lock is better.
Jamie Clarke
@jamie94bc
Feb 10 2016 14:55 UTC
Azure storage queues don't really have a name - you just update the visibility timeout
Eric J. Smith
@ejsmith
Feb 10 2016 14:55 UTC
    Task<IQueueEntry<T>> DequeueAsync(CancellationToken cancellationToken = default(CancellationToken));

    Task RenewLockAsync(IQueueEntry<T> queueEntry);

    Task CompleteAsync(IQueueEntry<T> queueEntry);

    Task AbandonAsync(IQueueEntry<T> queueEntry);
Jamie Clarke
@jamie94bc
Feb 10 2016 14:56 UTC
or ExtendLeaseAsync()
Blake Niemyjski
@niemyjski
Feb 10 2016 14:56 UTC
I like renew
Eric J. Smith
@ejsmith
Feb 10 2016 14:56 UTC
think that makes sense?
Blake Niemyjski
@niemyjski
Feb 10 2016 14:56 UTC
kinda follows the naming of our locks
Eric J. Smith
@ejsmith
Feb 10 2016 14:56 UTC
yeah, I like renewlock better too.
Jamie Clarke
@jamie94bc
Feb 10 2016 14:57 UTC
fine by me! :smile:
Blake Niemyjski
@niemyjski
Feb 10 2016 15:00 UTC

@ejsmith we can clean up our repos a bit… Add this to RDP into build worker on build failure:

on_failure:

Eric J. Smith
@ejsmith
Feb 10 2016 15:00 UTC
I don’t think we should be doing that.
that will hang the build on every failure.
Blake Niemyjski
@niemyjski
Feb 10 2016 15:01 UTC
well I’m going to use it to solve this issue.. but just saying… we can use that script when we want to debug and we can delete our enable rdp script out of our repos
Eric J. Smith
@ejsmith
Feb 10 2016 15:01 UTC
yeah, I guess it makes sure it’s always up to date.
Blake Niemyjski
@niemyjski
Feb 10 2016 15:02 UTC
yeah
Eric J. Smith
@ejsmith
Feb 10 2016 15:13 UTC
added the renew, but not doing anything in it for any of the queue impls right now.
running the tests to see where we are at.
Blake Niemyjski
@niemyjski
Feb 10 2016 15:13 UTC
running it with azure service bus connection string?
ok
Eric J. Smith
@ejsmith
Feb 10 2016 15:14 UTC
nope
@jamie94bc how do you feel about servicebus?
Jamie Clarke
@jamie94bc
Feb 10 2016 15:16 UTC
@ejsmith as in how do I feel about the product or how would I like to add the renew impl? :smile:
Eric J. Smith
@ejsmith
Feb 10 2016 15:16 UTC
the product mostly
Jamie Clarke
@jamie94bc
Feb 10 2016 15:17 UTC
it's a bit OTT for what I need a queue/bus for - and the lack of an emulator isn't great fun (hence the storage queues PR)
Eric J. Smith
@ejsmith
Feb 10 2016 15:18 UTC
exactly
Jamie Clarke
@jamie94bc
Feb 10 2016 15:18 UTC
but they both have their trade offs - service bus supports long polling, storage queues don't
storage queues have a significantly faster response time
Eric J. Smith
@ejsmith
Feb 10 2016 15:18 UTC
I am not really a fan at all. I think it’s overly complex and the biggest issue I have is the lockin and not being able to run it locally.
Jamie Clarke
@jamie94bc
Feb 10 2016 15:20 UTC
apparently MS are moving away from emulators - so not sure what that will mean for the storage emulators
Blake Niemyjski
@niemyjski
Feb 10 2016 15:20 UTC
where did you see that?
Jamie Clarke
@jamie94bc
Feb 10 2016 15:20 UTC
currently moving away from cloud services too which are also a massive pain!
Eric J. Smith
@ejsmith
Feb 10 2016 15:20 UTC
there are some awesome new queues out there that are super simple and crazy fast too.
yeah, cloud services are a nightmare.
Blake Niemyjski
@niemyjski
Feb 10 2016 15:20 UTC
they seem to have a cult following tho
Eric J. Smith
@ejsmith
Feb 10 2016 15:21 UTC
they seem to slowly be getting it.
simplifying things.
Web Apps and Web Jobs are nice and simple.
I wish they would make Web Jobs a 1st class thing though.
Jamie Clarke
@jamie94bc
Feb 10 2016 15:22 UTC
"Service Bus for Windows Server is a separate server installation, but can be used. Azure is moving away from emulators."
Eric J. Smith
@ejsmith
Feb 10 2016 15:22 UTC
I think they will eventually ditch servicebus for something much simpler or just offer a hosted version of something like kafka or other queue products.
Blake Niemyjski
@niemyjski
Feb 10 2016 15:25 UTC
https://twitter.com/blaken/with_replies Look at the last two tweets I sent
that would be nice
would love them to have a hosted elastic search
kinda pist they didn’t do that for there documentdb
reinventing the wheel with crap that no one wants
sure I’d love to write sql against my document db
Eric J. Smith
@ejsmith
Feb 10 2016 15:57 UTC
@jamie94bc @niemyjski just pushed changes to the branch.
all tests work now
had to fix a bug in the in memory queue
none of the renewlocks do anything.
Jamie Clarke
@jamie94bc
Feb 10 2016 16:02 UTC
okay - on renewlocks i presume we're going to reuse the workItemTimeout passed in the ctor?
Eric J. Smith
@ejsmith
Feb 10 2016 16:03 UTC
yeah, that seems reasonable to me.
if you want to add implementations for the azure ones that would be greatly appreciated.
Jamie Clarke
@jamie94bc
Feb 10 2016 16:03 UTC
sure!
Eric J. Smith
@ejsmith
Feb 10 2016 16:06 UTC
thanks man!
Jamie Clarke
@jamie94bc
Feb 10 2016 16:06 UTC
it's nice to find a OS C# project that uses K&R style braces layout - makes a nice change :clap:
Blake Niemyjski
@niemyjski
Feb 10 2016 16:08 UTC
:)
yeah
can’t stand the other brace formats
Jamie Clarke
@jamie94bc
Feb 10 2016 16:10 UTC
yeah - too much whitespace, too many empty lines
Eric J. Smith
@ejsmith
Feb 10 2016 16:10 UTC
haha
yes!
I’m adding an event for lockrenewed
to match all the others.
pushing...
Jamie Clarke
@jamie94bc
Feb 10 2016 16:40 UTC
this should probably be a separate PR!
Blake Niemyjski
@niemyjski
Feb 10 2016 16:48 UTC
looks like the azure test is failing
on that branch
@jamie94bc any chance you could look into it?
Eric J. Smith
@ejsmith
Feb 10 2016 16:49 UTC
hrmm… they passed locally for me. Weird.
Jamie Clarke
@jamie94bc
Feb 10 2016 16:50 UTC
same here!
i presume that might be due to emulator vs. live?
DequeueAsync in AzureServiceBus
Blake Niemyjski
@niemyjski
Feb 10 2016 16:53 UTC
the tests fire up the emulator as well :)
Jamie Clarke
@jamie94bc
Feb 10 2016 16:53 UTC
RecieveAsync takes a TimeSpan overload - server timeout, how long the request lasts until it gives up
we're not exposing that anywhere and it's causing my renew lock tests to fail !
but we are using CancellationToken to do that in combination with TimeSpans...
Blake Niemyjski
@niemyjski
Feb 10 2016 16:55 UTC
I think we use cancellationtokens everywhere
instead of timespans
because you can have a ct cancel based on a timespan
and it’s cleaner
Jamie Clarke
@jamie94bc
Feb 10 2016 16:58 UTC
yeah I see why but service bus supports timeouts server side through long polling as opposed to repeated polling like storage queues - so cancellationTokens are useless here
Blake Niemyjski
@niemyjski
Feb 10 2016 17:01 UTC
yeah
I wonder if there is a way to get the timeout of a cancellation token?
Jamie Clarke
@jamie94bc
Feb 10 2016 17:03 UTC
interesting idea!
theoretically... yes
but it's pretty horrible
so we could use reflection... but i'd rather not! :worried:
Eric J. Smith
@ejsmith
Feb 10 2016 17:07 UTC
yeah, that’s not a good idea. :-)
reading to see what the problem is...
so you are calling recieve and you need to give it a timeout that is based on the dequeue’s timeout.
correct?
Jamie Clarke
@jamie94bc
Feb 10 2016 17:09 UTC
correct - noticed the issue as I expected Dequeue to return instantly in my CanRenewLock test
Eric J. Smith
@ejsmith
Feb 10 2016 17:09 UTC
gotcha
and they don’t take cancellationtoken
so we have a cancellationtoken, but we need a timeout.
Jamie Clarke
@jamie94bc
Feb 10 2016 17:10 UTC
no as the timeout is delt with server side in SB
only half decent solution I can think of is a TimeSpan overload
(without a CancellationToken)
Eric J. Smith
@ejsmith
Feb 10 2016 17:11 UTC
well, we have that as an extension method already...
but we want to limit the contract of the queues so it’s easier to make implementations.
only thing I can think of is to put the recieve in a loop with a small timeout and have the loop check the cancellation token.
but I would imagine that is not as efficient as calling recieve 1 time with a long timeout.
Jamie Clarke
@jamie94bc
Feb 10 2016 17:14 UTC
yeah that's not ideal!
i assume when you mentioned failing SB tests the other day it was related to this!
Eric J. Smith
@ejsmith
Feb 10 2016 17:17 UTC
so the only other alternative is to do the reflection thing, eh?
the timespan is internal?
Jamie Clarke
@jamie94bc
Feb 10 2016 17:18 UTC
worse - the timespan belongs to a timer which belongs to the token source
Blake Niemyjski
@niemyjski
Feb 10 2016 17:18 UTC
the good thing is we could wrap this into a helper method and test it
Eric J. Smith
@ejsmith
Feb 10 2016 17:18 UTC
hrmm.. decompile didn’t work for me.
Blake Niemyjski
@niemyjski
Feb 10 2016 17:18 UTC
sucks doing it but could make a helper to get it
Eric J. Smith
@ejsmith
Feb 10 2016 17:19 UTC
wonder if we could create a derived tokensource that exposes the timeout.
Blake Niemyjski
@niemyjski
Feb 10 2016 17:19 UTC
eh
Jamie Clarke
@jamie94bc
Feb 10 2016 17:19 UTC
actually i think reflection is a no go
Blake Niemyjski
@niemyjski
Feb 10 2016 17:19 UTC
yeah?
Jamie Clarke
@jamie94bc
Feb 10 2016 17:19 UTC
timer doesn't expose the interval nicely
(or internally)
Blake Niemyjski
@niemyjski
Feb 10 2016 17:20 UTC
creating our own token source kinda muddies everything
Eric J. Smith
@ejsmith
Feb 10 2016 17:20 UTC
from looking at the code, I think we could create a derived tokensource that exposes a datetime? when the token will expire.
then you could check to see if the token is of that type.
and cast to it
Blake Niemyjski
@niemyjski
Feb 10 2016 17:20 UTC
yeah..
that would work
I like that route
Jamie Clarke
@jamie94bc
Feb 10 2016 17:21 UTC
yeah that works too!
Jamie Clarke
@jamie94bc
Feb 10 2016 17:27 UTC
only thing there is CancellationToken is a struct
so you'll still need to do some reflection to get the FoundatioCancellationTokenSource (or whatever you want to call it)
Blake Niemyjski
@niemyjski
Feb 10 2016 17:32 UTC
Can everyone here +1 this (dotnet/roslyn#3169)
@jamie94bc you wouldn’t need to do it if you pass in timespan and we create the underlying token
but yeah, probably need to use reflection at some point
Eric J. Smith
@ejsmith
Feb 10 2016 17:35 UTC
kind of sucks… would need to experiment and see if there is some solution.
can’t do it right now.
Jamie Clarke
@jamie94bc
Feb 10 2016 17:49 UTC
This message was deleted
public class FoundatioCancellationTokenSource : CancellationTokenSource {
        public TimeSpan? Delay { get; }

        public FoundatioCancellationTokenSource() { }
        public FoundatioCancellationTokenSource(int millisecondsDelay)
            : this(TimeSpan.FromMilliseconds(millisecondsDelay)) { }
        public FoundatioCancellationTokenSource(TimeSpan delay) : base(delay) {
            this.Delay = delay;
        }
    }

    public static class CancellationTokenExtensions {
        private static readonly Lazy<FieldInfo> _sourceField = new Lazy<FieldInfo>(() => 
            typeof(CancellationToken).GetField("m_source", BindingFlags.Instance | BindingFlags.NonPublic)); 

        public static TimeSpan? GetDelay(this CancellationToken cancellationToken) {
            var cts = _sourceField.Value.GetValue(cancellationToken);

            return (cts as FoundatioCancellationTokenSource)?.Delay;
        }
    }
haven't tested it - this is how i'd think it would work
Eric J. Smith
@ejsmith
Feb 10 2016 17:56 UTC
yeah, something along those lines. Man, really sucks to have to use reflection… feel like there has got to be a better way.
Jamie Clarke
@jamie94bc
Feb 10 2016 17:59 UTC
it works - but I agree, TimeSpan overload would be my preferred option
Blake Niemyjski
@niemyjski
Feb 10 2016 18:38 UTC
For the get delay it would be better to check for our cancellation token first
but yeah, that would work
@jamie94bc I think we tried to do just timespan overloads about a year ago
and we had both timespans and cancellation tokens and we did a bunch of revs and we found it just be so much cleaner with tokens
Jamie Clarke
@jamie94bc
Feb 10 2016 19:05 UTC
@niemyjski not sure what you mean by "our cancellation token"?
Blake Niemyjski
@niemyjski
Feb 10 2016 19:05 UTC
the FoundatioCancellationToken
be better to check that first before falling back to the reflection
Jamie Clarke
@jamie94bc
Feb 10 2016 19:07 UTC
so we are going to change all the cancellationToken params to take FoundatioCancellationToken and support implicit cast from CancellationToken?
Blake Niemyjski
@niemyjski
Feb 10 2016 19:08 UTC
na, I think just use cancellation token (use existing) thoughts @ejsmith
Eric J. Smith
@ejsmith
Feb 10 2016 19:09 UTC
I think the preferred solution is for other libs to support cancellation tokens.
But that isn't going to happen. :-)
Problem is if we add an overload for 1 method then you pretty much need to do it for all of them.
And that sucks.
Jamie Clarke
@jamie94bc
Feb 10 2016 19:12 UTC
no i think it makes sense with Dequeue - because you're asking to wait for an item to appear in the queue
i don't think the rest would need it
Eric J. Smith
@ejsmith
Feb 10 2016 19:12 UTC
thats true
I guess that is the cleanest thing to do. Everything else feels pretty badly.
Hacky
Eric J. Smith
@ejsmith
Feb 10 2016 20:23 UTC
So I guess we are going to agree to add the Dequeue overload to IQueue?
Blake Niemyjski
@niemyjski
Feb 10 2016 20:29 UTC
:(
can’t just check the token above? in this one usecase
Eric J. Smith
@ejsmith
Feb 10 2016 20:29 UTC
I don’t want to hack it and I think there are a lot of times that you want to specify how long to wait for a dequeue anyway.
which is why we have the extension method.
so I think adding the overload is he cleanest solution to the problem
Blake Niemyjski
@niemyjski
Feb 10 2016 20:31 UTC
ok
Blake Niemyjski
@niemyjski
Feb 10 2016 21:14 UTC
dammit
facetoptions only supports
string:int
not string:string
Blake Niemyjski
@niemyjski
Feb 10 2016 21:31 UTC
just built a very specifc and simple parser
Jamie Clarke
@jamie94bc
Feb 10 2016 21:48 UTC
i've added the timeout overload - will add renew functionality for sb and storage queue tomorrow :smile_cat:
Blake Niemyjski
@niemyjski
Feb 10 2016 21:51 UTC
cool
Blake Niemyjski
@niemyjski
Feb 10 2016 22:05 UTC
@ejsmith I need to write some tests for this…
let me know your thoughts
the facet options wouldn’t work due to string:string
and we didn’t care about nesting so yeah..
AppVeyor CI BOT [3:44 PM]
Build Foundatio 3.0.655 failed
Commit d76f1f05ff by Jamie Clarke on 2/10/2016 9:43 PM: ​Added timeout overload for Dequeue
something with timezones seems wrong
Jamie Clarke
@jamie94bc
Feb 10 2016 22:30 UTC
that's strange!
Blake Niemyjski
@niemyjski
Feb 10 2016 22:35 UTC
is it 9:43pm for you
maybe git has the timezone embedded
Jamie Clarke
@jamie94bc
Feb 10 2016 22:42 UTC
well it's 10:42pm now, but at the time of that commit yeah
Blake Niemyjski
@niemyjski
Feb 10 2016 22:42 UTC
hmm
Jamie Clarke
@jamie94bc
Feb 10 2016 22:43 UTC
any idea why the PR kills the build process? - GitLink error in AppVeyor
Blake Niemyjski
@niemyjski
Feb 10 2016 22:43 UTC
guessing gitlink can’t find the repo url
kinda odd
probably don’t want that running on pr's
Jamie Clarke
@jamie94bc
Feb 10 2016 22:45 UTC
useful for tests on prs though
Blake Niemyjski
@niemyjski
Feb 10 2016 22:45 UTC
not really
gitlink links github source code to pdb’s for symbolsource
it’s so we don’t have to go down with (symbolsource) every other day or configure anything in vs
unless I’m missing something
let me see if I can make that run on master only
Blake Niemyjski
@niemyjski
Feb 10 2016 22:53 UTC
@jamie94bc appveyor/ci#617
I don’t see it anywhere in there docs or spec file so I figured I’d ask first
Jamie Clarke
@jamie94bc
Feb 10 2016 22:55 UTC
okay cool - i'm not familiar with appveyor yet so we'll see what they say
Blake Niemyjski
@niemyjski
Feb 10 2016 22:55 UTC
we’ll get it building :)
thanks for your help
@frankebersoll I see they just pushed vs2015 update2 ctp.. wonder if it contains the .net 4.6 msbuild bug fix
over three hundred compiler bugs
how??
oh c++ :)
missed it
Blake Niemyjski
@niemyjski
Feb 10 2016 23:04 UTC
NEW INTERVIEW QUESTION for you all :) what will the following statement do: ((string)null)?.ToLower().Trim()
It’s not what you’d expect :D
I was thinking null reference on the Trim() but apparently it’s grouping the ToLower() and Trim() together
Jamie Clarke
@jamie94bc
Feb 10 2016 23:13 UTC
really?! i didn't think that was the expected behaviour
ah the behaviour with methods is different to properties?
so you can do A?.B.C and that will throw, but chained method calls won't