Stackdriver / collectd

Stackdriver's monitoring agent based on collectd (http://collectd.org).
https://cloud.google.com/monitoring/agent/
Other
51 stars 15 forks source link

Updated ps_get_owner() to return a stringified uid if process owner name is not set. #91

Closed rbuskens closed 7 years ago

kosak commented 7 years ago

In this interface I can't find igor's comment to reply to, so I'll comment right here.

I think it's a little chaotic to whipsaw this code back and forth like this. I think the strtoul with unsigned long was the best version. I don't know why you (igor) would recommend going back to the atoi version. I'm happy to continue to discuss this if my input is welcome (I'm also happy with the opposite of that statement) so let me know if I should continue. But personally I'd rather discuss it as a discussion, rather than the ObamaCare style repeal-and-replace approach that we're using now. 😸

kosak commented 7 years ago

PS I like @igorpeshansky's suggestion result = strndup (line + 5, uid_end - line - 5); I think that's the awesomest because it avoids all this snprintf and buffer size drama altogether.

rbuskens commented 7 years ago

Reverted back to using unsigned long as a worst-case assumption to give us lots of breathing room / future-proofing. Updated the code to avoid the buffer size drama altogether.

igorpeshansky commented 7 years ago

@kosak For the record, I've never suggested reverting to atoi. :-) I was also typing these on a phone while riding on a crowded train, so some context got mixed up (e.g., the "you" in "if you were worried..." referred to Rick and not Corey). I think the whole "repeal-and-replace" exchange was Rick being somewhat overeager to apply every comment as it appeared, rather than waiting for the dust to settle. That said, your input is definitely appreciated.

rbuskens commented 7 years ago

+1 to what Igor wrote, Corey!

kosak commented 7 years ago

Ah, ok. Thanks Igor. (and I wish I knew how to reply to a comment here). I definitely was getting confused by all the changes (and my aging brain only holds about 3 bits of information any more), so thanks for the clarification! And I'm always happy to drop in via parachute.

igorpeshansky commented 7 years ago

LGTM :shipit: