Skip to content
This repository was archived by the owner on Jan 10, 2019. It is now read-only.
This repository was archived by the owner on Jan 10, 2019. It is now read-only.

Trap handler in Worker calls logger (and other things) from trap context. #107

Description

@glennpratt

By configuring the WorkerOptions logger with a logger at level DEBUG:

aws_flow_defaults = AWSFlowDefaults.new(@logger)
AWS::Flow::WorkerOptions.default_classes << aws_flow_defaults

I see the logger being called from trap context:

Polling for a new activity task of type ["AcquiaCloudData.schema_create 1.0", "AcquiaCloudData.schema_delete 1.0"] on task_list: AcquiaCloudData
^Clog writing failed. can't be called from trap context
log writing failed. can't be called from trap context
log writing failed. can't be called from trap context
log writing failed. can't be called from trap context
log writing failed. can't be called from trap context
log writing failed. can't be called from trap context
1193 exited
1192 exited

It looks like the trap handler calls shutdown directly:

https://github.com/aws/aws-flow-ruby/blob/3e116d59e25a2e585117811d5bbb3e40f8b3e11e/aws-flow/lib/aws/decider/worker.rb#L47-L57

https://github.com/aws/aws-flow-ruby/blob/3e116d59e25a2e585117811d5bbb3e40f8b3e11e/aws-flow/lib/aws/decider/executor.rb#L87-L115

I'm not super familiar, but I would have the trap set a flag var or send something over a pipe or queue to the main loop and avoid doing any work, logging, etc.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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