Я хотел бы получить подписку на Google PubSub с помощью Go.Локально работает хорошо, но когда я развертываю его в Cloud Run, невозможно получить любое сообщение.
Здесь мой фрагмент кода
func (pubSubService *pubSubService) Received() (msgArray []*pubsub.Message, err error) {
ctx := context.Background()
cctx, cancel := context.WithCancel(ctx)
msgArray = []*pubsub.Message{}
var receivedMessage = make(chan *pubsub.Message)
go func() {
for {
select {
case msg := <-receivedMessage:
msgArray = append(msgArray, msg)
case <-time.After(pubSubService.waitTimeOutInMillis * time.Millisecond):
cancel()
}
}
}()
err = pubSubService.client.Subscription(pubSubService.subscriptionName).Receive(cctx, func(ctx context.Context, msg *pubsub.Message) {
receivedMessage <- msg
msg.Ack()
})
if err != nil {
return
}
return
}
Здесь ошибка журнала
D Container Sandbox Limitation: Unsupported syscall setsockopt(0x7,0x6,0x12,0xc00006f204,0x4,0x0)
D Container Sandbox Limitation: Unsupported syscall setsockopt(0x5,0x6,0x12,0xc0003c1204,0x4,0x0)
D Container Sandbox Limitation: Unsupported syscall setsockopt(0xa,0x6,0x12,0xc0003bd204,0x4,0x0)
D Container Sandbox Limitation: Unsupported syscall setsockopt(0xc,0x6,0x12,0xc00037d204,0x4,0x0)
D Container Sandbox Limitation: Unsupported syscall setsockopt(0x6,0x6,0x12,0xc0002d3204,0x4,0x0)
D Container Sandbox Limitation: Unsupported syscall setsockopt(0x8,0x6,0x12,0xc00052b204,0x4,0x0)
D Container Sandbox Limitation: Unsupported syscall setsockopt(0x9,0x6,0x12,0xc000391204,0x4,0x0)
D Container Sandbox Limitation: Unsupported syscall setsockopt(0xb,0x6,0x12,0xc00043b204,0x4,0x0)
D Container Sandbox Limitation: Unsupported syscall setsockopt(0x6,0x6,0x12,0xc0003b3204,0x4,0x0)
D Container Sandbox Limitation: Unsupported syscall setsockopt(0xc,0x6,0x12,0xc0003d3204,0x4,0x0)
D Container Sandbox Limitation: Unsupported syscall setsockopt(0x7,0x6,0x12,0xc000391204,0x4,0x0)
D Container Sandbox Limitation: Unsupported syscall setsockopt(0x5,0x6,0x12,0xc000309204,0x4,0x0)
D Container Sandbox Limitation: Unsupported syscall setsockopt(0xb,0x6,0x12,0xc0004d3204,0x4,0x0)
Полученный вызов фильтруется в изолированной программной среде GVisor Cloud Run
Знаете ли вы обходной путь или ReceiveSetting, чтобы установить для этой проблемы?Заранее спасибо.