Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frontend node stackoverflow while resolving recursive type of protobuf #10443

Closed
cea5 opened this issue Jun 20, 2023 — with Slack · 4 comments
Closed

frontend node stackoverflow while resolving recursive type of protobuf #10443

cea5 opened this issue Jun 20, 2023 — with Slack · 4 comments
Assignees
Milestone

Comments

Copy link

cea5 commented Jun 20, 2023

risingwave version: v0.19.0
docker logs:

thread 'risingwave-main' has overflowed its stack
fatal runtime error: stack overflow

when i create source from pulsar, the descripterset file(device_message.fds) is build from this proto file:

syntax = "proto3";

import "google/protobuf/struct.proto";

message DeviceReportPropertyMessage {
  string messageType = 1;  
  string messageId = 2;   
  int64 timestamp = 3;    
  string productId = 4;  
  string deviceId = 5;   
  string gatewayDeviceProductId = 6;    
  string gatewayDeviceId = 7; 
  google.protobuf.Struct headers = 8;
  google.protobuf.Struct properties = 9;  
  map<string, int64> propertySourceTime = 10;   
  map<string, string> propertyState = 11;   
}

the create sql:

CREATE SOURCE IF NOT EXISTS pulsar_dev_msg 
WITH (
   connector='pulsar',
   topic='persistent://cyfl-dev/iot-core/device-report-property',
   service.url='pulsar://10.40.0.203:6650/',
   scan.startup.mode='latest',
   scan.startup.timestamp_millis='140000000'
)
ROW FORMAT PROTOBUF MESSAGE 'DeviceReportPropertyMessage'
ROW SCHEMA LOCATION 'http://10.17.0.68:9301/proto/device_message.fds';

frontend-node-0 container crash every time i enter that create sql.

@github-actions github-actions bot added this to the release-0.20 milestone Jun 20, 2023
@st1page st1page assigned tabVersion and unassigned st1page Jun 21, 2023
@yuhao-su
Copy link
Contributor

message Struct {
  // Unordered map of dynamically typed values.
  map<string, Value> fields = 1;
}

// `Value` represents a dynamically typed value which can be either
// null, a number, a string, a boolean, a recursive struct value, or a
// list of values. A producer of value is expected to set one of these
// variants. Absence of any variant indicates an error.
//
// The JSON representation for `Value` is JSON value.
message Value {
  // The kind of value.
  oneof kind {
    // Represents a null value.
    NullValue null_value = 1;
    // Represents a double value.
    double number_value = 2;
    // Represents a string value.
    string string_value = 3;
    // Represents a boolean value.
    bool bool_value = 4;
    // Represents a structured value.
    Struct struct_value = 5;
    // Represents a repeated `Value`.
    ListValue list_value = 6;
  }
}

google.protobuf.Struct properties is a recursive type. We can cover this case by parsing it to Jsonb.

Meanwhile, we should ban other recursive types.

@cea5
Copy link
Author

cea5 commented Jun 21, 2023

How long will it takes to fix this bug ?

@neverchanje
Copy link
Contributor

neverchanje commented Jun 26, 2023

@cea5 I would not like to say that we will fix this as a bug, if you are indicating the support for protobuf's struct type.

We may still experiment on it, but it'd be better if you can workaround and use other types, such as google.protobuf.Any or just encoding the struct as a json string.

One possible means that we'll try is to convert the struct type to Postgres's JSONB, which basically shares the same semantic as Struct.

@BugenZhao BugenZhao changed the title frontend node stackoverflow frontend node stackoverflow while resolving recursive type of protobuf Jun 28, 2023
@tabVersion tabVersion modified the milestones: release-1.0, release-1.1 Jul 19, 2023
@tabVersion
Copy link
Contributor

close this one as handling recursive type is done.
more data type support will track in #10479

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants