Tuesday, 2019-07-30

*** njohnston has quit IRC00:02
*** njohnston has joined #openstack-oslo00:03
*** threestrands has joined #openstack-oslo00:10
*** threestrands has quit IRC03:30
*** threestrands has joined #openstack-oslo03:30
*** threestrands has quit IRC03:31
*** jaosorior has quit IRC04:05
*** jaosorior has joined #openstack-oslo05:04
*** Luzi has joined #openstack-oslo05:05
*** raildo has quit IRC05:11
*** raildo has joined #openstack-oslo05:12
*** d34dh0r53 has quit IRC05:25
*** shachar has quit IRC06:05
*** shachar has joined #openstack-oslo06:05
*** d34dh0r53 has joined #openstack-oslo06:17
*** jaosorior has quit IRC07:01
*** rcernin has quit IRC07:02
*** hberaud|gone is now known as hberaud07:06
*** tesseract has joined #openstack-oslo07:11
*** tosky has joined #openstack-oslo07:24
*** ralonsoh has joined #openstack-oslo07:58
*** lpetrut has joined #openstack-oslo08:18
*** purplerbot has quit IRC08:22
*** purplerbot has joined #openstack-oslo08:22
*** e0ne has joined #openstack-oslo08:45
*** jaosorior has joined #openstack-oslo08:45
openstackgerritpengyuesheng proposed openstack/oslo.config master: Blacklist sphinx 2.1.0 (autodoc bug)  https://review.opendev.org/66923408:53
*** hberaud is now known as hberaud|lunch09:47
*** dansmith has quit IRC09:52
*** dansmith has joined #openstack-oslo09:58
*** hberaud|lunch is now known as hberaud11:08
*** boden has joined #openstack-oslo11:47
*** ansmith has quit IRC11:47
*** njohnston has quit IRC11:56
*** njohnston has joined #openstack-oslo12:05
*** jaosorior has quit IRC12:07
*** hberaud has quit IRC12:29
*** hberaud has joined #openstack-oslo12:33
*** ansmith has joined #openstack-oslo12:40
*** kgiusti has joined #openstack-oslo12:42
*** jaosorior has joined #openstack-oslo12:54
*** iurygregory has quit IRC13:02
openstackgerritSandeep Yadav proposed openstack/oslo.messaging master: Correcting typo in acknowledge spelling  https://review.opendev.org/67351413:16
*** goldyfruit has joined #openstack-oslo13:24
*** iurygregory has joined #openstack-oslo13:29
*** Luzi has quit IRC13:55
*** e0ne has quit IRC14:04
*** e0ne has joined #openstack-oslo14:33
*** bobh has joined #openstack-oslo14:36
*** e0ne has quit IRC14:54
*** takamatsu has joined #openstack-oslo14:54
*** e0ne has joined #openstack-oslo15:04
*** e0ne has quit IRC15:59
*** lpetrut has quit IRC16:11
*** trident has quit IRC16:32
*** trident has joined #openstack-oslo16:37
*** goldyfruit has quit IRC16:53
*** hberaud is now known as hberaud|gone17:07
*** ralonsoh has quit IRC17:23
*** tesseract has quit IRC17:34
openstackgerritMerged openstack/oslo.messaging master: Correcting typo in acknowledge spelling  https://review.opendev.org/67351417:37
*** tosky has quit IRC17:43
efrieddhellmann: you know oslo.log, don'tcha?17:49
dhellmannefried : some, what's up?17:57
efrieddhellmann: http://lists.openstack.org/pipermail/openstack-discuss/2019-July/008059.html17:58
efriedTL;DR global_request_id isn't showing up in logs and I don't know why17:58
efriedbasically I want to understand where oslo.log looks for the %(global_request_id)s part of my configured format string17:58
dhellmannoslo.log is basically for configuring the stdlib logging module and oslo.context together17:59
dhellmannis there a context, and does it have the request id?17:59
efriedIn nova, a given request gets a context, yeah. And it has a global_id. But we're certainly not passing that context into any LOG.* calls. And if not that, then I'm not sure how oslo.log is supposed to be getting at it.18:00
dhellmannthe context is stored in a thread local inside oslo.context18:00
efriedoo. who does that?18:01
dhellmannhttps://opendev.org/openstack/oslo.context/src/branch/master/oslo_context/context.py#L27618:01
dhellmannunless you tell it otherwise, the library does that every time you make a new context18:01
dhellmannoh, I guess unless there is already one there18:01
efriedneat, /me looks at nova's RequestContext subclass...18:01
dhellmannI see where the context is added to the record for json and fluentd, but not standard text18:06
dhellmannoh, duh: https://opendev.org/openstack/oslo.log/src/branch/master/oslo_log/formatters.py#L42818:06
efrieddhellmann: Okay, so if my override [1] doesn't say otherwise, when I ask for context.global_id, I actually get the request_id (which may or may not have been generated, but is for sure there)18:06
efried[1] https://opendev.org/openstack/nova/src/branch/master/nova/context.py#L8118:06
efriedis oslo.log using context.global_request_id (the field) or context.global_id (the @property) in the format?18:08
efriedI'm guessing the former, and I'm guessing that's the disconnect.18:08
dhellmannglobal_id is a dynamic property of the context https://opendev.org/openstack/oslo.context/src/branch/master/oslo_context/context.py#L37818:08
dhellmannthe format string for context-aware log messages is https://opendev.org/openstack/oslo.log/src/branch/master/oslo_log/_options.py#L14718:09
dhellmannit has request_id18:09
dhellmannwhich comes from the to_dict() method https://opendev.org/openstack/oslo.context/src/branch/master/oslo_context/context.py#L35318:09
dhellmannwhich nova extends https://opendev.org/openstack/nova/src/branch/master/nova/context.py#L16518:10
efriedyeah, but in this case I'm overriding that and including global_request_id (this is devstack standard)18:10
dhellmannincluding to set request_id https://opendev.org/openstack/nova/src/branch/master/nova/context.py#L17718:10
efriedokay, so the bug here is that to_dict isn't supplying global_request_id!18:10
efried(nova's to_dict override, that is)18:10
dhellmannit should be18:10
dhellmannthe base sets it https://opendev.org/openstack/oslo.context/src/branch/master/oslo_context/context.py#L35418:10
efriedagree18:10
efriedthere's a weird note in there from dansmith18:11
dhellmannI don't see nova deleting it18:11
efriedsorry, dims18:11
efrieddhellmann: No, nova isn't deleting it - it's overriding to_dict entirely, not calling super() etc.18:11
dhellmannwhat is the devstack standard you're talking about? overriding the format string?18:11
efriedoh18:12
dhellmannnova does call super() line 16518:12
efriedit is calling super18:12
efriedhmph18:12
efriedhttp://logs.openstack.org/86/672986/1/check/nova-live-migration/e426c8a/logs/etc/nova/nova-cpu.conf.txt.gz18:12
dhellmannah18:12
efriedlogging_context_format_string = %(color)s%(levelname)s %(name)s [[01;36m%(global_request_id)s %(request_id)s [00;36m%(project_name)s %(user_name)s%(color)s] [01;35m%(instance)s%(color)s%(message)s[00m18:12
efriedbut http://logs.openstack.org/86/672986/1/check/nova-live-migration/e426c8a/logs/screen-n-cpu.txt.gz#_Jul_26_14_57_18_46032818:12
dhellmannwhich nova process is this?18:13
efriedcompute18:14
efriedn-cpu18:14
dhellmannso there's no web request, and we're relying on the context to be passed in by oslo.messaging18:14
dhellmannis that bit working? I wonder if we're not (de)serializing that properly?18:15
efriedoslo.messaging, oh, because this is at the behest of an RPC call from the API?18:15
dhellmannis the nova rpc receive setting the context? I can't remember if that happens in the RPC layer or the application layer18:15
dhellmannyeah18:15
efried...18:16
dhellmannbnemec-pto or kgiusti are more familiar with the messaging layer, but you could just test it by dumping the context in an rpc call18:16
dhellmannI do see functions like "unpack_context" in the oslo.messaging code18:17
dhellmannis this working properly for other services with a separate rpc backend like cinder?18:17
efrieddunno18:17
efriedI can barely spell RPC18:17
dhellmannyou're working on a bug. how do you know nova is working differently from anything else?18:18
dhellmanndo you see the request ids in the logs of the other services?18:18
efried"working on a bug" is probably giving more credit than due18:19
efriedLooking at cinder logs for same patch...18:20
efriedwould the equivalent be c-vol?18:20
dhellmannprobably?18:20
efriedsame thing appears to be the case there http://logs.openstack.org/86/672986/1/check/nova-live-migration/e426c8a/logs/screen-c-vol.txt.gz18:20
dhellmannok, so none of the services are working18:21
efriedand I'm assuming that guy's conf is http://logs.openstack.org/86/672986/1/check/nova-live-migration/e426c8a/logs/etc/cinder/cinder.conf.txt.gz which has the same placeholder18:21
dhellmannthe first thing I would do is try changing the devstack format string to use the name the default in oslo.log uses18:21
dhellmannmaybe the library and devstack got out of sync somewhere18:21
efriedbut the default doesn't have global_request_id in it.18:22
efriedand request_id is showing up18:22
dhellmannah, right18:22
dhellmannand I guess if you change global_request_id to global_id that's just going to log the request_id again18:23
dhellmannit looks like global_request_id is supposed to come from a header https://opendev.org/openstack/oslo.context/src/branch/master/oslo_context/context.py#L6218:23
efriedI reckon it will, yah.18:23
dhellmanndoes it show up properly in the nova api logs?18:23
dhellmannis the client setting it at all?18:24
efriedn-api doesn't have it either: http://logs.openstack.org/86/672986/1/check/nova-live-migration/e426c8a/logs/screen-n-api.txt.gz#_Jul_26_14_57_37_86255218:24
dhellmannok, that's telling18:24
dhellmannwhat do we expect is setting that value?18:24
efriednor does superconductor http://logs.openstack.org/86/672986/1/check/nova-live-migration/e426c8a/logs/screen-n-super-cond.txt.gz18:25
efriedI guess based on your explanation above I would have expected it to be set by... wsgi?18:25
dhellmannIIRC, that value is the request id from the originating request and should be set when one service calls another to tie the related service calls together18:26
dhellmannthat's how I see it being used in the first few projects that show up in http://codesearch.openstack.org/?q=global_request_id&i=nope&files=&repos=18:26
dhellmannit looks like keystoneauth sets it if it is given a value18:27
efriedyes, when we're going across the wire it's supposed to be in the x-openstack-request-id header18:27
dhellmannright18:27
efriedThing is, I know it's in the context being used for that placement call I showed you first18:27
efriedbecause I dumped it18:27
efriedand it shows up on the other side of the wire (placement)18:28
dhellmannso why do we think it should be set in this particular case? if OSC talks to nova directly, I wouldn't expect to see it set until nova talks to some other service.18:28
efriedit's just... not going into the log18:28
dhellmannok, so it *is* set?18:28
efriedso yeah, good point18:28
smcginnisNot sure if this helps at all - https://review.opendev.org/#/c/472224/18:28
dhellmannyeah, that's helpful18:29
dhellmannthose are good examples of what I was saying before, about how services are supposed to pass this to each other18:29
efriedright here is a call from n-cpu to placement http://logs.openstack.org/86/672986/1/check/nova-live-migration/e426c8a/logs/screen-n-cpu.txt.gz#_Jul_26_14_57_18_46032818:29
efriedif you look down a few lines you can see where I dumped the context.global_id18:29
efriedso it *is* set in the context. But it's not ending up in the log.18:30
efriedcould we be using a different context??18:30
dhellmannthat makes me wonder if the context object you were dumping it from is the same one the logging code sees18:30
dhellmannright18:30
efriedactually18:30
dhellmannthe logging code looks at that thread-local global value18:30
dhellmannwhere did you get the context you used?18:30
* efried backtraces...18:32
efriednova.context.get_admin_context()18:33
*** harlowja has quit IRC18:33
efriedoh18:33
dhellmannthat doesn't seem likely to be the same as the original request context18:34
efriedactually18:34
efriedthis call is coming from service start18:34
efriedso not a request at all18:34
efriedbut it's still *making* requests.18:34
efriedso it should probably set a global ID.18:34
dhellmannmaybe? I'm not sure18:37
efrieddhellmann: Okay, I've got some stuff I can play with at this point. Thanks a bunch for the help.18:39
dhellmannsure thing!18:40
efriedsmcginnis: thanks for that pointer. The service-to-service part is working. I'm trying to figure out why it's not showing up in the log.18:40
*** kgiusti has left #openstack-oslo18:43
*** bobh has quit IRC18:56
*** boden has quit IRC19:05
*** boden has joined #openstack-oslo19:09
*** bobh has joined #openstack-oslo19:36
*** bobh has quit IRC19:42
*** boden has quit IRC20:15
*** e0ne has joined #openstack-oslo20:16
*** e0ne has quit IRC20:41
*** bobh has joined #openstack-oslo20:42
*** e0ne has joined #openstack-oslo20:42
*** ansmith has quit IRC20:44
*** zbitter is now known as zaneb20:44
*** bobh has quit IRC20:48
*** bobh has joined #openstack-oslo21:05
*** bobh has quit IRC21:05
*** e0ne has quit IRC21:16
*** njohnston has quit IRC21:52
*** njohnston has joined #openstack-oslo21:54
*** bobh has joined #openstack-oslo21:59
*** raildo has quit IRC22:02
*** ansmith has joined #openstack-oslo22:27
*** bobh has joined #openstack-oslo22:54
*** rcernin has joined #openstack-oslo23:01

Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!