profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/n1rna/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

n1rna/bitcoin-address-oracle 1

Bitcoin address generator UbiOps deployment

dawyi/instagram-bazi 0

crawl insta shit

n1rna/404-PageNotFound 0

:boom: A curated list of "404 Page Not Found" pages

n1rna/Amplitude-JavaScript 0

JavaScript SDK for Amplitude

n1rna/ansible-playbooks 0

Playbooks for automating server procedures based on our Community guides

n1rna/bips 0

Bitcoin Improvement Proposals

n1rna/bitcoin 0

Bitcoin Core integration/staging tree

fork n1rna/go-term-markdown

A markdown renderer package for the terminal

fork in 11 days

startedDaveOff/UnpromoteTwitter

started time in 13 days

push eventn1rna/cheatcli

Nima Yazdanmehr

commit sha 3ce489032ed08b66ec6bb09a96dcd180e16829b9

Add streaming output for git executor

view details

push time in 17 days

push eventn1rna/cheatcli

Nima

commit sha f6b1b010bafe5dea4d2e4455de9f4a1662b79489

Add init command and some cleanups

view details

Nima Yazdanmehr

commit sha 7c9053b78c4782fe182d4d18015d38c06cc7024b

Refactor show and sync commands with the new FileDB

view details

push time in 17 days

startedsipa/writeups

started time in 21 days

issue openedrpy2/rpy2

Terminating R function without causing the python process to terminate

Describe the issue or bug

I have tried several things now, but none of them seem to be working properly. Please take a look at the snippet below:

import os
import rpy2.rinterface

import contextlib
import signal

import rpy2.rinterface


class RequestCancelledByUSR1(Exception):
    pass


@contextlib.contextmanager
def request_abort():
    # signal.signal(signal.SIGUSR1, _raise_for_cancelled_for_r)
    signal.signal(signal.SIGUSR1, _raise_for_cancelled)

    try:
        yield
    except RequestCancelledByUSR1:
        raise
    finally:
        signal.signal(signal.SIGUSR1, signal.SIG_IGN)


def _raise_for_cancelled(signum, frame):
    raise RequestCancelledByUSR1


def _raise_for_cancelled_for_r(signum, frame):
    rquit = rpy2.rinterface.baseenv['q']
    rquit("yes", 255, True)


pkg_info = {
    'environment_variables': {},
    'language': 'r4.0',
    'path': '..'
}

wrapped_r = load_r_code(pkg_info)

def cleanup(saveact, status, runlast):
    print("cleanup called")
    return None

rpy2.rinterface_lib.callbacks.cleanup = cleanup

print("PID:", os.getpid())
try:
    with request_abort():
        wrapped_r.request({'input': 10})
except Exception as e:
    print("Exception got here", str(e))

What I am trying to achieve right now, is that if the SIGUSR1 was sent to this process, the RequestCancelledByUSR1 should be raised by the request_abort context manager and eventually the stack trace should end up in the except block.

But as you can see, if I use the _raise_for_cancelled which will only raise the exception, it will not cause the embedded r to die and it will continue to work and the program will not continue with the rest. And if I use the rquit logic by assigning _raise_for_cancelled_for_r as my SIGUSR1 handler, it will cause the whole process to exit and it will not let the program continue (It won't reach the except block - It will just exit)

Do you think there is a way to do it safely, without needing to run the embedded r code in a separate process and killing that process explicitly?

created time in a month

fork n1rna/bitcoin-intro

Start Using Bitcoin

fork in a month

push eventn1rna/bitcoin-address-oracle

nima

commit sha 021a7a4137b5e71748f19edf54dab9c10d864ada

Fix some typos

view details

push time in a month

push eventn1rna/bitcoin-address-oracle

nima

commit sha 2a4f76d426cd7a81fbcb1237f7bf38eca09eedf2

Try to fix share jpg file

view details

push time in a month

push eventn1rna/bitcoin-address-oracle

nima

commit sha 8e20c4eb5c8247ef63a508d9788529e0e4eb36b6

Add share image to assets

view details

push time in a month

push eventn1rna/bitcoin-address-oracle

nima

commit sha 0c37db261d95ab87866b5d04f88b5b83383581c0

Update meta tags

view details

push time in a month

push eventn1rna/bitcoin-address-oracle

nima

commit sha ed1b196422cacefc649be3b12b5077e9ac05c08f

Try to fix github action

view details

push time in a month

push eventn1rna/bitcoin-address-oracle

nima

commit sha 7c469572f6f61694441525a3c2d3e07ed0c8e7a3

Fix build label file name

view details

push time in a month

push eventn1rna/bitcoin-address-oracle

nima

commit sha 42c13ea9b2485ebbb72cb88c0a7547b2f9d8d428

Fix typo in labels extension

view details

push time in a month

push eventn1rna/bitcoin-address-oracle

nima

commit sha 3282bb21ca999afdc573e5960300d3615ad04264

Fix some typos and add Readme file

view details

push time in a month

startedirsl/gcp-dhcp-takeover-code-exec

started time in a month

push eventn1rna/bitcoin-address-oracle

nima

commit sha adc81b8b7694fb3f6a147014c11277cbc7232e13

Fix typo

view details

push time in a month

push eventn1rna/bitcoin-address-oracle

nima

commit sha 0e3f5ddb417a7a99ec259233e0359b3cbe544c0f

Fix typo

view details

push time in a month

push eventn1rna/bitcoin-address-oracle

nima

commit sha 972e0881b3166af212e6713b460d65318fc6abaa

Fix typo

view details

push time in a month

push eventn1rna/bitcoin-address-oracle

nima

commit sha 61bb9c4d9a53f451f50edf3ce49296469f7b3135

Fix condition for null

view details

push time in a month

push eventn1rna/bitcoin-address-oracle

nima

commit sha ca7233e7139999504549151a823faca42d93db8b

Fix typo

view details

push time in a month

push eventn1rna/bitcoin-address-oracle

nima

commit sha e7273aa8ab528b7c1c50ff77dc227a5e0aa921c4

Fix using exit code

view details

push time in a month

push eventn1rna/bitcoin-address-oracle

nima

commit sha 1772b3880d953c439736fbd1beee43cb7f5b54d4

Add qr code min js and fix fetchInvoice function

view details

push time in a month

push eventn1rna/bitcoin-address-oracle

nima

commit sha c5406106ce49f06f8b676011a10cc6584b48234e

Fix job condition

view details

push time in a month

push eventn1rna/bitcoin-address-oracle

nima

commit sha ba5adac245f490ec18f29d70730a56a2d62d4346

Try to fix deployment update

view details

push time in a month

push eventn1rna/bitcoin-address-oracle

nima

commit sha 095f18a8608cd64f6338e842fc21be27099b8c3f

Update public token

view details

push time in a month

push eventn1rna/bitcoin-address-oracle

nima

commit sha a297889f6e2978d901de509ae02fd97c7d4073c5

Use xpub instead of mnemonic and add experiment description to index

view details

push time in a month

push eventn1rna/website

Nima

commit sha 42af0d2f58b490a2aa7d1ab160dc1764ab420bc8

Remove paragraph about TTLAfterFinished feature gate

view details

push time in 2 months

pull request commentkubernetes/website

Fix feature state version for jobs ttl

I also think the last paragraph of the edited section should be removed. The part that mentions the feature gate for TTLAfterFinished. If you agree, let me know so I can fix it.

n1rna

comment created time in 2 months