Skip to content

plugin driver - switch to threads instead of tokio for loading plugins #68

@YOU54F

Description

@YOU54F

There is an issue affecting Pact-Go users, whereby using plugins will cause sporadic segmentation faults.

The root issue cause of the issue tokio-rs/tokio#3520 - Signals do not add SA_ONSTACK which may cause linked Go applications to crash

We can switch to using std::process in rust, introduced in this commit for windows, which uses threads instead of tokio tasks

threaded version

tokio version

I've tested this out on my fork and it's resulting in stable ci runs for pact-go cross platform utilising the following pact plugins (avro, csv, protobuf, matt)

Note: Avro plugin has failed to load on windows since moving to threads in commit

Amending the following logback.xml from the installed pact-avro-plugin

From

https://github.com/austek/pact-avro-plugin/blob/main/modules/plugin/src/main/resources/logback.xml

To

<configuration>
</configuration>

will allow the plugin framework to pick up the plugins loaded message (serverKey and port).

So there may be a change required in the pact-avro-plugin to support.

This can easily be reproduced with on a windows machine by performing pact-plugin-cli install -y avro

It would be nice to implement the plugin timeout for loading - todo here by an env var possibly (so its usable by ffi & cli users easily)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions