ibm-messaging / mq-golang

Calling IBM MQ from Go applications
Apache License 2.0
168 stars 60 forks source link

Unknown PCF type 150994944 #161

Closed rjseibert closed 2 years ago

rjseibert commented 3 years ago

Please include the following information in your ticket.

- Version information for MQ, mq-golang, Go compiler

I am connecting to a z/OS queue manager.


Build         : 20210111-112128
--
  | Commit Level  : 3ff0d76
  | Build Platform: Darwin/

- A small code sample that demonstrates the issue.

Error:  mqiPCF.go: Unknown PCF type 150994944
Buffer: [...]

goroutine 1 [running]:
--
  | runtime/debug.Stack(0x2c5bb, 0x0, 0x0)
  | /usr/lib/go-1.13/src/runtime/debug/stack.go:24 +0x9d
  | runtime/debug.PrintStack()
  | /usr/lib/go-1.13/src/runtime/debug/stack.go:16 +0x22
  | github.com/ibm-messaging/mq-golang/v5/ibmmq.ReadPCFParameter(0xc00022e024, 0xffdc, 0xffdc, 0xc000218780, 0x24)
  | /go/src/github.com/ibm-messaging/mq-metric-samples/vendor/github.com/ibm-messaging/mq-golang/v5/ibmmq/mqiPCF.go:301 +0x8f0
  | github.com/ibm-messaging/mq-golang/v5/mqmetric.inquireObjects(0x7fff07e2d399, 0x1, 0x1, 0x1, 0xffffffffffffffff, 0x0, 0x0, 0x587d27)
  | /go/src/github.com/ibm-messaging/mq-metric-samples/vendor/github.com/ibm-messaging/mq-golang/v5/mqmetric/discover.go:884 +0xbb5
  | github.com/ibm-messaging/mq-golang/v5/mqmetric.discoverQueues(0x7fff07e2d399, 0x1, 0x7fff07e2d399, 0x1)
  | /go/src/github.com/ibm-messaging/mq-metric-samples/vendor/github.com/ibm-messaging/mq-golang/v5/mqmetric/discover.go:681 +0x50c
  | github.com/ibm-messaging/mq-golang/v5/mqmetric.discoverAndSubscribe(0x0, 0x0, 0x7fff07e2d399, 0x1, 0x1, 0x7fff07e2d4fa, 0x7, 0x411200, 0x10, 0x43482a)
  | /go/src/github.com/ibm-messaging/mq-metric-samples/vendor/github.com/ibm-messaging/mq-golang/v5/mqmetric/discover.go:295 +0x367
  | github.com/ibm-messaging/mq-golang/v5/mqmetric.DiscoverAndSubscribe(0x0, 0x0, 0x7fff07e2d399, 0x1, 0x1, 0x7fff07e2d4fa, 0x7, 0x0, 0x203000)
  | /go/src/github.com/ibm-messaging/mq-metric-samples/vendor/github.com/ibm-messaging/mq-golang/v5/mqmetric/discover.go:220 +0xab
  | main.main()
  | /go/src/github.com/ibm-messaging/mq-metric-samples/cmd/mq_prometheus/main.go:129 +0x10fc

I found this snippet of code: https://github.com/ibm-messaging/mq-golang/blob/master/ibmmq/mqiPCF.go#L298

I find the comment particularly humorous.

rjseibert commented 3 years ago

I should note that this may be related to queues with usage=XMITQ being interpreted as usage=NORMAL queues.

rjseibert commented 3 years ago

This is possibly related to https://github.com/ibm-messaging/mq-golang/issues/133.

ibmmqmet commented 3 years ago

It does sound the same as #133. It looks like you've set the monitoredQueuePatterns parameter - possibly set to '*'. How many queues do you have defined that match that pattern? And since it's z/OS, is the qmgr in a QSG?

rjseibert commented 3 years ago

We have between 600 and 700 queues. Some are in QSGs and some are not.

ibmmqmet commented 3 years ago

Thanks for that. The numbers combined with the stack info have given me a couple of theories. One is around the resizing of buffers.

In vendor.../mqmetric/discover.go, round about line 860, there's a line bufsize:=32768. If you change that to 327680, it might now work for you. If it does work, that wouldn't be a proper fix, and it's not my only theory, but at least it would prove something.

rjseibert commented 3 years ago

@ibmmqmet, your suggestion did indeed work. I opened a PR for increasing the bufsize, but I do understand that it is not a "proper" fix.

ibmmqmet commented 2 years ago

Properly fixed in v5.2.3